djsbotbase-test
Version:
Discord.js tabanlı komut ve etkinlik sistemlerine sahip bir bot temeli
57 lines (56 loc) • 2.32 kB
TypeScript
import type { CommandHandlerConstructorData } from "./commandTypes";
import type { Client } from "discord.js";
import { Message, Interaction } from "discord.js";
import { SlashCommand } from "./slashCommandClass";
import { Command } from "./commandClass";
export declare class CommandHandler {
private readonly commandMap;
private readonly slashCommandMap;
private readonly commandsDir;
private readonly slashCommandsDir;
private readonly developerIds;
private readonly prefix;
private readonly suppressWarnings;
private readonly messages;
private readonly maintenance;
private readonly commandRunner;
private readonly slashCommandRunner;
constructor(data?: CommandHandlerConstructorData);
private validateAndNormalizeConfig;
private validateMessages;
setCommands(): Promise<void>;
private loadCommandsFromDirectory;
private getValidCommandFiles;
private isValidScriptFile;
private loadCommandFromFile;
private validateAndAddCommand;
setSlashCommands(): Promise<void>;
private loadSlashCommandsFromDirectory;
private getValidSlashCommandFiles;
private loadSlashCommandFromFile;
private validateAndAddSlashCommand;
private normalizeDirectoryPath;
runDefaultHandler(message: Message, prefixOverride?: string): void;
private shouldProcessMessage;
private parseCommand;
private isCommandExecutableInContext;
private handleCooldown;
private handleMaintenance;
private handleDeveloperOnly;
runDefaultSlashHandler(interaction: Interaction): void;
private shouldProcessInteraction;
setDefaultHandler(client: Client): this;
removeDefaultHandler(client: Client): this;
setDefaultSlashHandler(client: Client): this;
removeDefaultSlashHandler(client: Client): this;
getCommand(commandName: string): Command | undefined;
getCommands(): Command[];
getCommandOrAliases(commandOrAliasName: string): Command | undefined;
clearCommands(): this;
removeCommand(commandName: string): this;
getSlashCommands(): SlashCommand[];
getSlashCommand(slashCommandName: string): SlashCommand | undefined;
clearSlashCommands(): this;
registerSlashCommands(client: Client, guildId?: string): Promise<void>;
removeSlashCommand(slashCommandName: string): this;
}