Skip to content

DynamicGuildContextCommandHandler

Class: DynamicGuildContextCommandHandler<Context>

Section titled “Class: DynamicGuildContextCommandHandler<Context>”

Defined in: handlers/DynamicContextCommandHandler.ts:44

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

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

  • DynamicContextCommandHandlerBase<Context>

Context extends BaseInteractionContext = BaseInteractionContext

new DynamicGuildContextCommandHandler<Context>(): DynamicGuildContextCommandHandler<Context>

DynamicGuildContextCommandHandler<Context>

DynamicContextCommandHandlerBase<Context>.constructor

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

Defined in: handlers/DynamicContextCommandHandler.ts:11

DynamicContextCommandHandlerBase.handlerType


readonly scope: "guild"

Defined in: handlers/DynamicContextCommandHandler.ts:47

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