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.
Extends
Section titled “Extends”DynamicContextCommandHandlerBase<Context>
Type Parameters
Section titled “Type Parameters”Context
Section titled “Context”Context extends BaseInteractionContext = BaseInteractionContext
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new DynamicGlobalContextCommandHandler<
Context>():DynamicGlobalContextCommandHandler<Context>
Returns
Section titled “Returns”DynamicGlobalContextCommandHandler<Context>
Inherited from
Section titled “Inherited from”DynamicContextCommandHandlerBase<Context>.constructor
Properties
Section titled “Properties”handlerType
Section titled “handlerType”
readonlyhandlerType:"dynamic-context"="dynamic-context"
Defined in: handlers/DynamicContextCommandHandler.ts:11
Inherited from
Section titled “Inherited from”DynamicContextCommandHandlerBase.handlerType
readonlyscope:"global"
Defined in: handlers/DynamicContextCommandHandler.ts:60
Overrides
Section titled “Overrides”DynamicContextCommandHandlerBase.scope
Methods
Section titled “Methods”addHandler()
Section titled “addHandler()”addHandler(
handler):this
Defined in: handlers/DynamicContextCommandHandler.ts:20
Adds the command handler function.
Parameters
Section titled “Parameters”handler
Section titled “handler”(interaction) => any
The function to handle the context command interaction. Receives both
User and Message context interactions — narrow with interaction.isOfType(...).
Returns
Section titled “Returns”this
Inherited from
Section titled “Inherited from”DynamicContextCommandHandlerBase.addHandler
execute()
Section titled “execute()”execute(
interaction):Promise<void>
Defined in: handlers/DynamicContextCommandHandler.ts:28
Executes the command handler
Parameters
Section titled “Parameters”interaction
Section titled “interaction”DynamicContextInteraction<Context>
Returns
Section titled “Returns”Promise<void>
Inherited from
Section titled “Inherited from”DynamicContextCommandHandlerBase.execute
