From 07de442c019df68cb8d60b0b509b2445fa263e23 Mon Sep 17 00:00:00 2001 From: GRZ4NA Date: Wed, 8 Sep 2021 19:22:33 +0200 Subject: [PATCH] added method templates --- src/commands/CommandManager.ts | 24 ++++++++++++++++++++++++ src/commands/types/commands.ts | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/commands/CommandManager.ts b/src/commands/CommandManager.ts index d2facdb..e796045 100644 --- a/src/commands/CommandManager.ts +++ b/src/commands/CommandManager.ts @@ -1,4 +1,9 @@ +import { Interaction, Message } from "discord.js"; import { BaseCommand } from "./BaseCommand.js"; +import { ChatCommand } from "./ChatCommand.js"; +import { MessageCommand } from "./MessageCommand.js"; +import { CommandType } from "./types/BaseCommand.js"; +import { CommandInteractionData } from "./types/commands.js"; export class CommandManager { private readonly _commands: BaseCommand[] = []; @@ -9,4 +14,23 @@ export class CommandManager { this.prefix = prefix; this.argumentSeparator = argSep || ","; } + + public add(command: BaseCommand): void {} + + public get( + q: string, + t?: T + ): (T extends "CHAT" ? ChatCommand : T extends "MESSAGE" ? MessageCommand : T extends "USER" ? MessageCommand : BaseCommand) | null { + return null; + } + + public list( + filter?: T + ): T extends "CHAT" ? ChatCommand[] : T extends "MESSAGE" ? MessageCommand[] : T extends "USER" ? MessageCommand[] : BaseCommand[] { + return []; + } + + public fetch(i: T): CommandInteractionData | null { + return null; + } } diff --git a/src/commands/types/commands.ts b/src/commands/types/commands.ts index 3e33d26..7509a52 100644 --- a/src/commands/types/commands.ts +++ b/src/commands/types/commands.ts @@ -8,7 +8,7 @@ export type CommandStructure = T extends "MESSAGE" ? MessageCommand : T exten export type CommandResolvable = BaseCommand | ChatCommand | MessageCommand | UserCommand; -export interface CommandInteractionData { - command: BaseCommand; +export interface CommandInteractionData { + command: T; parameters: InputParameter[]; }