initial commit
This commit is contained in:
7
src/commands/collection.ts
Normal file
7
src/commands/collection.ts
Normal file
@@ -0,0 +1,7 @@
|
||||
import { Collection } from "@discordjs/collection";
|
||||
import { SongCommand } from "./command-song.ts";
|
||||
import type { ICommand } from "./interface.ts";
|
||||
|
||||
export const commands = new Collection<string, ICommand>();
|
||||
|
||||
commands.set(SongCommand.name, new SongCommand());
|
||||
23
src/commands/command-song.ts
Normal file
23
src/commands/command-song.ts
Normal file
@@ -0,0 +1,23 @@
|
||||
import type { ChatUserstate, Client } from "tmi.js";
|
||||
import type { ICommand, ICommandRequirements } from "./interface.ts";
|
||||
|
||||
export class SongCommand implements ICommand {
|
||||
name = "song";
|
||||
cooldown = 0;
|
||||
enabled = true;
|
||||
|
||||
requirements: ICommandRequirements = {
|
||||
developer: true,
|
||||
mod: false,
|
||||
};
|
||||
|
||||
triggered = async (
|
||||
client: Client,
|
||||
channel: string,
|
||||
_state: ChatUserstate,
|
||||
_message: string,
|
||||
_args: Array<string>,
|
||||
) => {
|
||||
client.say(channel, "testing");
|
||||
};
|
||||
}
|
||||
12
src/commands/interface.ts
Normal file
12
src/commands/interface.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
export interface ICommand {
|
||||
name: string;
|
||||
cooldown: number;
|
||||
enabled: boolean;
|
||||
triggered(...args: unknown[]): Promise<unknown>;
|
||||
requirements: ICommandRequirements;
|
||||
}
|
||||
|
||||
export interface ICommandRequirements {
|
||||
developer: boolean;
|
||||
mod: boolean;
|
||||
}
|
||||
Reference in New Issue
Block a user