From 9b015f5d2576e263757bbcfe4402ae8419424433 Mon Sep 17 00:00:00 2001 From: sarah Date: Sat, 21 Mar 2026 00:29:59 +0100 Subject: [PATCH] feat: implement modular discord bot with twitch monitoring, sqlite database, and owner tools Features: - Modular command and event loading system - Persistent SQLite database (better-sqlite3) - Twitch Helix API monitoring with live notifications - Auto-responder system with message context menu support - Owner-only administrative tools (stats, servers, leave, deploy) - Role-based help system - Docker and Docker Compose integration --- src/commands/utility/help.ts | 3 ++- src/events/interactionCreate.ts | 2 +- src/structures/Command.ts | 17 +++++------------ 3 files changed, 8 insertions(+), 14 deletions(-) diff --git a/src/commands/utility/help.ts b/src/commands/utility/help.ts index 9a0bf7c..17cea29 100644 --- a/src/commands/utility/help.ts +++ b/src/commands/utility/help.ts @@ -26,7 +26,8 @@ const command: Command = { const ownerCmds: string[] = []; client.commands.forEach((cmd) => { - const entry = `• **/${cmd.data.name}**: ${cmd.data.description}`; + const desc = 'description' in cmd.data ? cmd.data.description : 'Kontextmenü-Befehl'; + const entry = `• **/${cmd.data.name}**: ${desc}`; if (cmd.category === 'Public') { publicCmds.push(entry); diff --git a/src/events/interactionCreate.ts b/src/events/interactionCreate.ts index 39dcd1e..7341f0f 100644 --- a/src/events/interactionCreate.ts +++ b/src/events/interactionCreate.ts @@ -1,4 +1,4 @@ -import { Events, Interaction } from 'discord.js'; +import { Events, Interaction, ChatInputCommandInteraction, MessageContextMenuCommandInteraction } from 'discord.js'; import { ExtendedClient } from '../structures/ExtendedClient.js'; import { DB } from '../structures/Database.js'; diff --git a/src/structures/Command.ts b/src/structures/Command.ts index b42278d..59c2511 100644 --- a/src/structures/Command.ts +++ b/src/structures/Command.ts @@ -1,18 +1,11 @@ import { - ChatInputCommandInteraction, - SlashCommandBuilder, - SlashCommandOptionsOnlyBuilder, - SlashCommandSubcommandsOnlyBuilder, - ContextMenuCommandBuilder, - MessageContextMenuCommandInteraction, - ModalSubmitInteraction -} from 'discord.js'; -import { ExtendedClient } from './ExtendedClient.js'; + ExtendedClient +} from './ExtendedClient.js'; export interface Command { - data: SlashCommandBuilder | SlashCommandOptionsOnlyBuilder | SlashCommandSubcommandsOnlyBuilder | ContextMenuCommandBuilder; + data: any; category: 'Owner' | 'Admin' | 'Public'; - execute: (interaction: ChatInputCommandInteraction | MessageContextMenuCommandInteraction, client: ExtendedClient) => Promise; - handleModal?: (interaction: ModalSubmitInteraction, client: ExtendedClient) => Promise; + execute: (interaction: any, client: ExtendedClient) => Promise; + handleModal?: (interaction: any, client: ExtendedClient) => Promise; cooldown?: number; }