diff --git a/src/index.ts b/src/index.ts index f9f2b19..6b12402 100644 --- a/src/index.ts +++ b/src/index.ts @@ -6,6 +6,7 @@ import statusService from "./services/status.service"; import "reflect-metadata"; import { AppDataSource } from "./data-source"; +import { CommandDefinition } from "./type"; configDotenv(); @@ -24,7 +25,7 @@ const client = new Client({ ] }); -const commands = new Collection void, buttons?: {id: string, handle: (interaction : ButtonInteraction) => void}[]}>(); +const commands = new Collection(); const foldersPath = path.join(__dirname, 'commands'); const commandFolders = fs.readdirSync(foldersPath); diff --git a/src/type.d.ts b/src/type.d.ts index 84a3850..ae586b1 100644 --- a/src/type.d.ts +++ b/src/type.d.ts @@ -1 +1,2 @@ -type Host = { host: string, name: string, alive: boolean, type: 'ping' | 'website' }; \ No newline at end of file +export type Host = { host: string, name: string, alive: boolean, type: 'ping' | 'website' }; +export type CommandDefinition = { data: SlashCommandBuilder, execute: (interaction: ChatInputCommandInteraction) => void, buttons?: { id: string, handle: (interaction: ButtonInteraction) => void}[]}; \ No newline at end of file