RepliableHandler
Shared base the repliable interaction handlers extend.
Not a public entry point. Extend SlashHandler, ButtonHandler, ModalHandler, ContextMenuHandler, or one of the select menu bases instead. This class binds the core reply base to the gateway sender.
abstract class RepliableHandler<
Event extends Repliables
> extends RepliableHandler<
Event,
Core,
SentMessage,
GatewayFile,
ReplySender
>Member visibility
Filter class members by access level.
constructor
Constructs a new instance of the RepliableHandler class
protected RepliableHandler(
event: Event,
core: TCore,
dispatch: DispatchContext,
sender?: TSender
)Inherited from:RepliableHandler
Event
The repliable interaction type this handler processes
Event extends Repliablescore
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
routeId
protected readonly routeId: stringInherited from:RepliableHandler
sender
The reply surface for this interaction. Pass the handler to reply from outside its class.
readonly sender: TSenderInherited from:RepliableHandler
protected buildSender(
event: Event,
core: Core,
dispatch: DispatchContext
): ReplySenderdefer()
Show a "thinking" placeholder, then fill it later with edit.
Inherited from:RepliableHandler
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.
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
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