make command registering a bit easier

This commit is contained in:
Darius
2025-09-29 00:55:05 +02:00
parent b22cbf160c
commit 9097266197
2 changed files with 12 additions and 8 deletions

View File

@@ -1,12 +1,16 @@
import { Collection } from "@discordjs/collection";
import { PingCommand } from "./impl/ping.ts";
import { SongCommand } from "./impl/song.ts";
import { VanishCommand } from "./impl/vanish.ts";
import type { ICommand } from "./interface.ts";
export const commands = new Collection<string, ICommand>();
const cmds: Array<ICommand> = [];
const songCommand = new SongCommand();
const pingCommand = new PingCommand();
cmds.push(new SongCommand());
cmds.push(new PingCommand());
cmds.push(new VanishCommand());
commands.set(songCommand.name, songCommand);
commands.set(pingCommand.name, pingCommand);
for (const command of cmds) {
commands.set(command.name, command);
}