respond() at a glance
What respond(interaction) gives a handler: each method and property of the response state.
| Call | What it does |
|---|---|
respond(interaction) | The response state of an interaction, through which its replies, edits, follow-ups and errors go. |
Methods
| Method | What 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 |
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 |
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
| Property | What 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 |