abstract class RoleMenuHandler<
Defs extends readonly AnyCustomId[]
> extends SelectMenuHandler<SelectInteraction<APIMessageRoleSelectInteractionData>, Defs>Member visibility
Filter class members by access level.
InteractionHandler(
event: Event,
core: Core,
dispatch: DispatchContext,
sender: ReplySender
)Inherited from:InteractionHandler
Defs
The customId definitions this handler decodes, e.g. [typeof GrantId].
Defs extends readonly AnyCustomId[]protected api: APIInherited from:RepliableHandler
core
readonly core: TCoreInherited from:BaseHandler
dispatch
The bag for this dispatch. Each interaction gets its own. Every handler for one event shares a single bag.
protected readonly dispatch: DispatchContextInherited from:BaseHandler
event
protected readonly event: EventInherited from:BaseHandler
logger
protected readonly logger: LoggerInherited from:BaseHandler
The decoded params of the single route this handler is registered for.
Reading this decodes this.event.data.custom_id once and caches the result. On a handler
registered for several routes this is never. Use match instead.
protected params: SingleParams<Defs>Inherited from:ComponentHandler
Throws:
A StaleCustomId when the wire was encoded under an older shape. The dispatcher boundary turns it into a reply.
An InvalidCustomId when the wire is corrupt. The dispatcher boundary turns it into a reply.
protected roles: Collection<string, APIRole>protected readonly route: Defs[number]['prefix']Inherited from:ComponentHandler
sender
The reply surface for this interaction. Pass the handler to reply from outside its class.
readonly sender: TSenderInherited from:RepliableHandler
protected user: APIUserInherited from:RepliableHandler
protected values: string[]Inherited from:SelectMenuHandler
defer()
Show a "thinking" placeholder, then fill it later with edit.
Inherited from:RepliableHandler
Inherited from:ComponentHandler
delete()
Delete the initial reply or deferred placeholder. Pass a target to delete a message a prior send returned.
Inherited from:RepliableHandler
edit()
Rewrite the initial reply or deferred placeholder. The targeted form rewrites a message a prior send returned.
protected async edit(
response: ReplyResponse<TNative> | string
): Promise<TMessage>Inherited from:RepliableHandler
execute()
Holds the main logic of your handler. The dispatcher calls it after the handler's gates pass, so a
gate that refuses stops execute() from running.
abstract execute(): Promisable<void>Inherited from:BaseHandler
followUp()
Send a new message once the interaction is acknowledged.
protected async followUp(
response: ReplyResponse<TNative> | string,
opts?: SendOpts
): Promise<TMessage>Inherited from:RepliableHandler
Run the case for whichever route the component was minted from. Use this only when the handler is
registered for several routes. On a single-route handler, read this.params directly. On a multi-route
handler this.params is never, so match is the only way to read the decoded params.
Provide one case per registered route, keyed by its prefix, and each case receives that route's own
decoded params. The compiler checks that the cases cover every registered route prefix. match
decodes the wire before it runs a case.
protected async match<Ret, Cases>(
cases: OnlyCases<Cases, MatchCases<Defs, Ret>>
): Promise<MatchResult<Ret, Cases>>casesOne callback per registered route, keyed by prefix.
RetThe type that every case must return. Leave it out to get the union of what the cases return.
Throws:
A SeedcordTypeError with MatchCaseMissing when the wire's prefix doesn't have a case.
Throws:
A StaleCustomId when the wire was encoded under an older shape.
Throws:
An InvalidCustomId when the wire is corrupt.
Inherited from:ComponentHandler
reply()
Send the initial response, exactly once.
protected async reply(
response: ReplyResponse<TNative> | string,
opts?: SendOpts
): Promise<TMessage>Inherited from:RepliableHandler
send()
Routes to reply, followUp, or edit based on the current ack state.
protected async send(
response: ReplyResponse<TNative> | string,
opts?: SendOpts
): Promise<TMessage>Inherited from:RepliableHandler
protected async showModal(
this: InteractionHandler<
Exclude<Repliables, APIModalSubmitInteraction>
>,
modal: ModalLike
): Promise<void>Inherited from:InteractionHandler
protected async update(
response: ReplyResponse | string
): Promise<SentMessage>Inherited from:ComponentHandler