make command registering a bit easier
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user