dc_respond_interaction

dc_respond_interaction(interaction, type, content?)#

Sends a response to an interaction.

Blocking function

Invoking this function can freeze the game. Use it in a task to avoid freezing your game.

Input parameters#

Parameter Type Description
interaction Any interaction The interaction to respond to.
type String The type of response to use.
content (See response types) The data of the response, depending on the type.

Response types#

String Description
respond_later Tells that the interaction was received, and a response will come later.
You will then need to send a RESPOND_FOLLOWUP response within 15 minutes.
The content parameter optionally accepts Respond Later Data object.
respond_immediately Sends an immediate response which has to come within 3 seconds.
The content parameter requires a Message content object for this.
respond_followup Sends a followup response for RESPOND_LATER.
The content parameter requires a Message content object for this.
respond_modal Opens a modal for the user.
The content parameter requires a Modal object for this.

Output values#

Return values#

  • Null, if successful.
  • The message that was sent, if using the respond_followup or respond_immediately type.

Uncaught exceptions #

  • Throws an exception on failure.