Skip to content

DynamicGuildSlashCommandHandler

Class: DynamicGuildSlashCommandHandler<Context>

Section titled “Class: DynamicGuildSlashCommandHandler<Context>”

Defined in: handlers/DynamicSlashCommandHandler.ts:59

Fallback handler for guild-scoped slash commands whose name isn’t known ahead of time (e.g. per-guild custom commands), or that don’t match any registered SlashCommandHandler.

When an invocation has a guild_id, this handler is tried before DynamicGlobalSlashCommandHandler. Only one instance may be registered per Honocord instance via loadHandlers.

  • DynamicSlashCommandHandlerBase<Context>

Context extends BaseInteractionContext = BaseInteractionContext

new DynamicGuildSlashCommandHandler<Context>(): DynamicGuildSlashCommandHandler<Context>

DynamicGuildSlashCommandHandler<Context>

DynamicSlashCommandHandlerBase<Context>.constructor

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

Defined in: handlers/DynamicSlashCommandHandler.ts:7

DynamicSlashCommandHandlerBase.handlerType


readonly scope: "guild"

Defined in: handlers/DynamicSlashCommandHandler.ts:62

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