Nostrum.Api.create_reaction
You're seeing just the function
create_reaction
, go back to Nostrum.Api module for more information.
Specs
create_reaction( Nostrum.Struct.Channel.id(), Nostrum.Struct.Message.id(), emoji() ) :: error() | {:ok}
Creates a reaction for a message.
This endpoint requires the VIEW_CHANNEL
and READ_MESSAGE_HISTORY
permissions. Additionally, if nobody else has reacted to the message with
the emoji
, this endpoint requires the ADD_REACTIONS
permission. It
fires a Nostrum.Consumer.message_reaction_add/0
event.
If successful, returns {:ok}
. Otherwise, returns Nostrum.Api.error/0
.
Examples
# Using a Nostrum.Struct.Emoji.
emoji = %Nostrum.Struct.Emoji{id: 43819043108, name: "foxbot"}
Nostrum.Api.create_reaction(123123123123, 321321321321, emoji)
# Using a base 16 emoji string.
Nostrum.Api.create_reaction(123123123123, 321321321321, "\xF0\x9F\x98\x81")
For other emoji string examples, see Nostrum.Struct.Emoji.api_name/0
.