ContextMenuHandler
Base class for a context-menu command handler on the HTTP transport (right-click a user or a message).
Pass the kind from ApplicationCommandType as the generic. Read the right-clicked entity from this.target, an APIUser for a user menu and an APIMessage for a message menu. Context menus carry no options, so a handler registered for several names reads this.target uniformly with no per-name branch.
abstract class ContextMenuHandler<
Kind extends ContextMenuKind
> extends InteractionHandler<InteractionFor<Kind>>Member visibility
Filter class members by access level.
constructor
Constructs a new instance of the InteractionHandler class
InteractionHandler(
event: Event,
core: Core,
dispatch?: DispatchContext
)Inherited from:InteractionHandler
Showing members with Protected visibility and higher.
Properties
Methods
Kind
ApplicationCommandType.User or ApplicationCommandType.Message.
Kind extends ContextMenuKindapi
Typed Discord REST API (@discordjs/core/http-only) over core.rest, one instance per core. The interaction callbacks on api.interactions bypass the reply surface. The no-raw-interaction-acks rule flags them in handler classes.
protected api: APIInherited from:RepliableHandler
protected target: TargetFor<Kind>protected targetMember: TargetMemberFor<Kind>buildSender()
protected buildSender(
event: Event,
core: Core,
routeId: string
): ReplySenderInherited from:RepliableHandler
showModal()
Open a modal. Must be the initial response to this interaction. The modal kind rejects this call at compile time (Discord forbids a modal in response to a modal).
protected async showModal(
this: InteractionHandler<
Exclude<Repliables, APIModalSubmitInteraction>
>,
modal: ModalLike
): Promise<void>Inherited from:InteractionHandler