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);
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import type { UserIdResolvable } from "@twurple/api";
|
||||
import { Config } from "../config/config";
|
||||
import { apiClient } from "../core/api-client";
|
||||
import { getUserId } from "./general";
|
||||
import { logError } from "./logger";
|
||||
import { Config } from "../config/config.ts";
|
||||
import { apiClient } from "../core/api-client.ts";
|
||||
import { getUserId } from "./general.ts";
|
||||
import { logError } from "./logger.ts";
|
||||
|
||||
export async function timeoutByIds(
|
||||
channelId: UserIdResolvable,
|
||||
|
||||
Reference in New Issue
Block a user