Nostrum.Api.create_interaction_response
You're seeing just the function
create_interaction_response
, go back to Nostrum.Api module for more information.
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.
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
: AnInteractionResponse
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
.