Overview
Reactions are managed through thetangle.client.reactions package, which provides message types for adding, removing, and tracking reactions on messages.
Adding Reactions
Add an emoji reaction to a message using theAddReaction message.
AddReaction
Reference to the chat containing the message
Snowflake ID of the message to react to
The emoji to add as a reaction
Protocol Definition
Removing Reactions
Remove an emoji reaction from a message using theRemoveReaction message.
RemoveReaction
Reference to the chat containing the message
Snowflake ID of the message to remove the reaction from
The emoji reaction to remove
Protocol Definition
Reaction Emoji
TheReactionEmoji message represents the emoji used in reactions.
A unicode emoji string (e.g., ”👍”, “❤️”)
Protocol Definition
Custom emoji support is planned for future compatibility but not currently implemented.
Message Reactions
TheMessageReactions message contains all reactions for a specific message.
MessageReactions
Snowflake ID of the message
Array of reaction fields, each representing a unique emoji and its data
Protocol Definition
Message Reaction Field
EachMessageReactionField represents aggregated data for a specific emoji on a message.
The emoji this field represents
Total number of users who reacted with this emoji
Whether the current user has reacted with this emoji
Array of user snowflake IDs showing a preview of users who reacted
Protocol Definition
Example Usage
To add a thumbs up reaction to a message:- Create an
AddReactionmessage with the chat reference, message ID, and emoji - The
emojifield should contain aReactionEmojiwithunicode_emojiset to ”👍” - Send the message to add the reaction
RemoveReaction with the same parameters.