Skip to content
GitHub

respond() at a glance

What respond(interaction) gives a handler: each method and property of the response state.

CallWhat it does
respond(interaction)

The response state of an interaction, through which its replies, edits, follow-ups and errors go.

Methods

MethodWhat it does
acknowledge(options?)

Acknowledges the interaction without answering it yet: a deferred reply for a command, and an invisible deferred update for a component or a modal from a message.

lock(options?)

Locks the message a component is on, as @Defer's second step does: snapshots its components and embeds, disables its controls, shows the loading emoji on the clicked button, and adds the presenter's loading view.

send(payload, options?)

Sends the answer: a reply to an unanswered command, an update of an unanswered component's message, and an edit once the interaction is deferred or replied.

edit(payload, options?)

Edits the answer, routed as send() is: an edit once the interaction is answered.

followUp(payload, options?)

Sends another message after the answer.

delete()

Deletes the answer: the reply, or for a component deferred without a reply of its own, its message.

modal(modal)

Shows a modal.

error(error, options?)

Presents an error, styled by the application's presenter, and never throws.

Properties

PropertyWhat it holds
location

Where the interaction happened, and whether the bot can reach the channel there.

state

Where the answer stands, re-read from the interaction so answers made around this state count.

message

The message this state last replied with, updated or edited, never a follow-up, or the message a component is on.

original

The components and embeds of the message before @Defer locked it; undefined until then.