Skip to content

DynamicGlobalContextCommandHandler

Class: DynamicGlobalContextCommandHandler<Context>

Section titled “Class: DynamicGlobalContextCommandHandler<Context>”

Defined in: handlers/DynamicContextCommandHandler.ts:57

Fallback handler for global user/message context commands whose name isn’t known ahead of time, or that don’t match any registered ContextCommandHandler. Also catches unmatched guild-scoped invocations when no DynamicGuildContextCommandHandler is registered.

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

  • DynamicContextCommandHandlerBase<Context>

Context extends BaseInteractionContext = BaseInteractionContext

new DynamicGlobalContextCommandHandler<Context>(): DynamicGlobalContextCommandHandler<Context>

DynamicGlobalContextCommandHandler<Context>

DynamicContextCommandHandlerBase<Context>.constructor

readonly handlerType: "dynamic-context" = "dynamic-context"

Defined in: handlers/DynamicContextCommandHandler.ts:11

DynamicContextCommandHandlerBase.handlerType


readonly scope: "global"

Defined in: handlers/DynamicContextCommandHandler.ts:60

DynamicContextCommandHandlerBase.scope

addHandler(handler): this

Defined in: handlers/DynamicContextCommandHandler.ts:20

Adds the command handler function.

(interaction) => any

The function to handle the context command interaction. Receives both User and Message context interactions — narrow with interaction.isOfType(...).

this

DynamicContextCommandHandlerBase.addHandler


execute(interaction): Promise<void>

Defined in: handlers/DynamicContextCommandHandler.ts:28

Executes the command handler

DynamicContextInteraction<Context>

Promise<void>

DynamicContextCommandHandlerBase.execute