Skip to content
Classhttpv0.10.2

RepliableHandler

Shared base the repliable HTTP 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 http sender.

abstract class RepliableHandler<
    Event extends Repliables
> extends RepliableHandler<
    Event,
    Core,
    SentMessage,
    never,
    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

Showing members with Protected visibility and higher.

Event

The repliable interaction type this handler processes

Event extends Repliables

api

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: API

dispatch

The bag for this dispatch. Each interaction gets its own. Every handler for one event shares a single bag.

protected readonly dispatch: DispatchContext

Inherited from:BaseHandler

event

protected readonly event: Event

Inherited from:BaseHandler

sender

The reply surface for this interaction. Pass the handler to reply from outside its class.

readonly sender: TSender

Inherited from:RepliableHandler

delete()

Delete the initial reply or deferred placeholder. Pass a target to delete a message a prior send returned.

protected async delete(target?: TMessage): Promise<void>

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(): Promise<void>

Inherited from:BaseHandler