Refactor to more consistent structure (e.g. "plugins")

This commit is contained in:
2025-07-06 15:23:03 -04:00
parent a6255de889
commit 6fb38d36f3
22 changed files with 567 additions and 600 deletions

32
plugin.ts Normal file
View File

@@ -0,0 +1,32 @@
import type { ChatInputCommandInteraction, Client, SlashCommandBuilder } from "discord.js";
import type { Sequelize } from "sequelize";
export interface Settings {
// Main Discord client object
client: Client;
// Database access object
database: Sequelize;
}
export interface Command {
data: SlashCommandBuilder;
execute: (iteraction: ChatInputCommandInteraction) => Promise<void>;
}
export interface Plugin {
start: () => Promise<void>;
stop: () => Promise<void>;
commands: Command[]
}
export class BasePlugin implements Plugin {
settings: Settings;
commands: Command[]
constructor(settings: Settings) {
this.settings = settings;
}
async start() {}
async stop() {}
}