mirror of
https://github.com/thedrewen/protojx-manager.git
synced 2026-03-21 09:48:56 +01:00
feat(types): define CommandDefinition type for command handling
This commit is contained in:
@@ -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<string, {data: SlashCommandBuilder, execute: (interaction: ChatInputCommandInteraction) => void, buttons?: {id: string, handle: (interaction : ButtonInteraction) => void}[]}>();
|
||||
const commands = new Collection<string, CommandDefinition>();
|
||||
|
||||
const foldersPath = path.join(__dirname, 'commands');
|
||||
const commandFolders = fs.readdirSync(foldersPath);
|
||||
|
||||
3
src/type.d.ts
vendored
3
src/type.d.ts
vendored
@@ -1 +1,2 @@
|
||||
type Host = { host: string, name: string, alive: boolean, type: 'ping' | 'website' };
|
||||
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}[]};
|
||||
Reference in New Issue
Block a user