add easy setup
This commit is contained in:
14
src/commands/base-command.ts
Normal file
14
src/commands/base-command.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import { chatClient } from "../core/chat-client.ts";
|
||||
import type { ICommand, ICommandRequirements } from "./interface";
|
||||
|
||||
export abstract class BaseCommand implements ICommand {
|
||||
protected get chatClient() {
|
||||
return chatClient;
|
||||
}
|
||||
|
||||
abstract name: string;
|
||||
abstract cooldown: number;
|
||||
abstract enabled: boolean;
|
||||
abstract triggered(...args: unknown[]): Promise<unknown>;
|
||||
abstract requirements: ICommandRequirements;
|
||||
}
|
||||
@@ -1,8 +1,9 @@
|
||||
import type { ChatMessage } from "@twurple/chat";
|
||||
import { logSuccess } from "../logger/logger.ts";
|
||||
import type { ICommand, ICommandRequirements } from "./interface.ts";
|
||||
import { logSuccess } from "../util/logger.ts";
|
||||
import { BaseCommand } from "./base-command.ts";
|
||||
import type { ICommandRequirements } from "./interface.ts";
|
||||
|
||||
export class SongCommand implements ICommand {
|
||||
export class SongCommand extends BaseCommand {
|
||||
name = "song";
|
||||
cooldown = 0;
|
||||
enabled = true;
|
||||
|
||||
Reference in New Issue
Block a user