Nostrum.Api.create_interaction_response

You're seeing just the function create_interaction_response, go back to Nostrum.Api module for more information.
Link to this function

create_interaction_response(interaction, response)

View Source

Specs

create_interaction_response(Nostrum.Struct.Interaction.t(), map()) ::
  {:ok} | error()

Same as create_interaction_response/3, but directly takes the Nostrum.Struct.Interaction.t/0 received from the gateway.

Link to this function

create_interaction_response(id, token, response)

View Source

Specs

create_interaction_response(
  Nostrum.Struct.Interaction.id(),
  Nostrum.Struct.Interaction.token(),
  map()
) :: {:ok} | error()

Create a response to an interaction received from the gateway.

Parameters

  • id: The interaction ID to which the response should be created.
  • token: The interaction token.
  • response: An InteractionResponse object. See the linked documentation.

Example

response = %{
  type: 4,
  data: %{
    content: "I copy and pasted this code."
  }
}
Nostrum.Api.create_interaction_response(interaction, response)

As an alternative to passing the interaction ID and token, the original Nostrum.Struct.Interaction.t/0 can also be passed directly. See create_interaction_response/1.