CommandHandler
Signature
export declare class CommandHandler extends BaseHandlerProperties
7Methods
24constructorreloadreloadAllshouldUploadLocalesshouldUploadChoicesshouldUploadOptionshouldUploadcheckSubCommandsLimitsetloadparseLocalesgetLocalesgetLocaleKeyparseGlobalLocalesparseCommandOptionLocalesparseCommandLocalesparseContextMenuLocalesparseSubCommandLocalesstablishContextCommandDefaultsstablishCommandDefaultsstablishSubCommandDefaultsonFileonCommandonSubCommand
Properties
protected logger: Logger;protected client: UsingClient;values: (Command | ContextMenuCommand)[];entryPoint: EntryPointCommand | null;filter: (path: string) => boolean;Filters a file path.
Parameters
path- The path to filter.
Returns
`true` if the path passes the filter, otherwise `false`.
private prepareCommand;private normalizeLoadOptions;Methods
constructorConstructorconstructor(logger: Logger, client: UsingClient);reload(resolve: string | Command): Promise<Command | EntryPointCommand | ContextMenuCommand | null>;reloadAll(stopIfFail?: boolean): Promise<void>;protected shouldUploadLocales(locales?: LocalizationMap | null, cachedLocales?: LocalizationMap | null): boolean;protected shouldUploadChoices(option: APIApplicationCommandOption, cached: APIApplicationCommandOption): boolean;protected shouldUploadOption(option: APIApplicationCommandOption, cached: APIApplicationCommandOption): boolean;shouldUpload(file: string, guildId?: string): Promise<boolean>;checkSubCommandsLimit(command: Command): void;set(commands: SeteableCommand[], optionsOrTransform?: CommandLoadTransformer | CommandLoadOptions): (Command | EntryPointCommand | ContextMenuCommand)[];load(commandsDir: string, client: UsingClient, options?: CommandLoadOptions): Promise<(Command | ContextMenuCommand)[]>;parseLocales(command: InstanceType<HandleableCommand>): Command | EntryPointCommand | ContextMenuCommand | SubCommand;protected getLocales(locale: string): ("id" | "en-US" | "en-GB" | "bg" | "zh-CN" | "zh-TW" | "hr" | "cs" | "da" | "nl" | "fi" | "fr" | "de" | "el" | "hi" | "hu" | "it" | "ja" | "ko" | "lt" | "no" | "pl" | "pt-BR" | "ro" | "ru" | "es-ES" | "es-419" | "sv-SE" | "th" | "tr" | "uk" | "vi")[];protected getLocaleKey(locale: string, key: string, context: string): string | undefined;parseGlobalLocales(command: InstanceType<HandleableCommand>): void;parseCommandOptionLocales(option: CommandOption, commandName?: string): void;parseCommandLocales(command: Command): void;parseContextMenuLocales(command: ContextMenuCommand): ContextMenuCommand;parseSubCommandLocales(command: SubCommand): SubCommand;stablishContextCommandDefaults(commandInstance: InstanceType<HandleableCommand>): ContextMenuCommand | false;stablishCommandDefaults(commandInstance: InstanceType<HandleableCommand>): OmitInsert<Command, 'options', { options: NonNullable<Command['options']>;}> | false;stablishSubCommandDefaults(commandInstance: Command, option: SubCommand): SubCommand;onFile(file: FileLoaded): HandleableCommand[] | undefined;onCommand(file: SeteableCommand, create?: CommandLoadCreator): HandleableCommandInstance | false;onSubCommand(file: HandleableSubCommand): SubCommand | false;