Skip to content

DynamicGlobalSlashCommandHandler

Class: DynamicGlobalSlashCommandHandler<Context>

Section titled “Class: DynamicGlobalSlashCommandHandler<Context>”

Defined in: handlers/DynamicSlashCommandHandler.ts:72

Fallback handler for global slash commands whose name isn’t known ahead of time, or that don’t match any registered SlashCommandHandler. Also catches unmatched guild-scoped invocations when no DynamicGuildSlashCommandHandler is registered.

Only one instance may be registered per Honocord instance via loadHandlers.

  • DynamicSlashCommandHandlerBase<Context>

Context extends BaseInteractionContext = BaseInteractionContext

new DynamicGlobalSlashCommandHandler<Context>(): DynamicGlobalSlashCommandHandler<Context>

DynamicGlobalSlashCommandHandler<Context>

DynamicSlashCommandHandlerBase<Context>.constructor

readonly handlerType: "dynamic-slash" = "dynamic-slash"

Defined in: handlers/DynamicSlashCommandHandler.ts:7

DynamicSlashCommandHandlerBase.handlerType


readonly scope: "global"

Defined in: handlers/DynamicSlashCommandHandler.ts:75

DynamicSlashCommandHandlerBase.scope

addAutocompleteHandler(handler): this

Defined in: handlers/DynamicSlashCommandHandler.ts:26

Adds the autocomplete handler function.

(interaction) => any

The function to handle the autocomplete interaction

this

DynamicSlashCommandHandlerBase.addAutocompleteHandler


addHandler(handler): this

Defined in: handlers/DynamicSlashCommandHandler.ts:16

Adds the command handler function.

(interaction) => any

The function to handle the command interaction

this

DynamicSlashCommandHandlerBase.addHandler


execute(interaction): Promise<void>

Defined in: handlers/DynamicSlashCommandHandler.ts:34

Executes the command handler

ChatInputCommandInteraction<Context>

Promise<void>

DynamicSlashCommandHandlerBase.execute


executeAutocomplete(interaction): Promise<void>

Defined in: handlers/DynamicSlashCommandHandler.ts:44

Executes the autocomplete handler if it exists

AutocompleteInteraction<Context>

Promise<void>

DynamicSlashCommandHandlerBase.executeAutocomplete