32 lines
741 B
TypeScript
32 lines
741 B
TypeScript
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() {}
|
|
} |