Archived
added method templates
This commit is contained in:
1 parent
037a4a5999
commit
07de442c01
2 files changed
+26
-2
No files matched your search
@@ -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<T extends CommandType>(
|
||||
q: string,
|
||||
t?: T
|
||||
): (T extends "CHAT" ? ChatCommand : T extends "MESSAGE" ? MessageCommand : T extends "USER" ? MessageCommand : BaseCommand) | null {
|
||||
return null;
|
||||
}
|
||||
|
||||
public list<T extends CommandType>(
|
||||
filter?: T
|
||||
): T extends "CHAT" ? ChatCommand[] : T extends "MESSAGE" ? MessageCommand[] : T extends "USER" ? MessageCommand[] : BaseCommand[] {
|
||||
return [];
|
||||
}
|
||||
|
||||
public fetch<T extends Interaction | Message>(i: T): CommandInteractionData<T extends Interaction ? BaseCommand : ChatCommand> | null {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -8,7 +8,7 @@ export type CommandStructure<T> = T extends "MESSAGE" ? MessageCommand : T exten
|
||||
|
||||
export type CommandResolvable = BaseCommand | ChatCommand | MessageCommand | UserCommand;
|
||||
|
||||
export interface CommandInteractionData {
|
||||
command: BaseCommand;
|
||||
export interface CommandInteractionData<T extends CommandResolvable> {
|
||||
command: T;
|
||||
parameters: InputParameter[];
|
||||
}
|
||||
Reference in new issue
Block a user