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.targetthis.target, an APIUserAPIUser for a user menu and an APIMessageAPIMessage for a message menu. Context menus carry no options, so a handler registered for several names reads this.targetthis.target uniformly with no per-name branch.
abstract class ContextMenuHandler<
Kind extends ContextMenuKind
> extends InteractionHandler<InteractionFor<Kind>>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 InteractionHandlerInteractionHandler class
InteractionHandler(
event: Event,
core: Core,
dispatch?: DispatchContext
)InteractionHandler(
event: Event,
core: Core,
dispatch?: DispatchContext
)Inherited from:InteractionHandler
Showing members with Protected visibility and higher.
Properties
Methods
Kind
ApplicationCommandType.UserApplicationCommandType.User or ApplicationCommandType.MessageApplicationCommandType.Message.
Kind extends ContextMenuKindKind extends ContextMenuKindprotected targetMember: TargetMemberFor<Kind>protected targetMember: TargetMemberFor<Kind>buildSender()
protected buildSender(
event: Event,
core: Core,
routeId: string
): ReplySenderprotected 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>protected async showModal(
this: InteractionHandler<
Exclude<Repliables, APIModalSubmitInteraction>
>,
modal: ModalLike
): Promise<void>Inherited from:InteractionHandler