Skip to main content
The reactions system allows users to react to messages with emoji, providing a lightweight way to express sentiment or acknowledgment without sending a full message.

Overview

Reactions are managed through the tangle.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 the AddReaction message.

AddReaction

chat_ref
refs.ChatRef
required
Reference to the chat containing the message
message_id
fixed64
required
Snowflake ID of the message to react to
emoji
ReactionEmoji
required
The emoji to add as a reaction

Protocol Definition

message AddReaction {
  refs.ChatRef chat_ref = 1;
  // @snowflake<Message>
  fixed64       message_id = 2;
  ReactionEmoji emoji   = 3;
}

Removing Reactions

Remove an emoji reaction from a message using the RemoveReaction message.

RemoveReaction

chat_ref
refs.ChatRef
required
Reference to the chat containing the message
message_id
fixed64
required
Snowflake ID of the message to remove the reaction from
emoji
ReactionEmoji
required
The emoji reaction to remove

Protocol Definition

message RemoveReaction {
  refs.ChatRef chat_ref = 1;
  // @snowflake<Message>
  fixed64       message_id = 2;
  ReactionEmoji emoji   = 3;
}

Reaction Emoji

The ReactionEmoji message represents the emoji used in reactions.
unicode_emoji
string
A unicode emoji string (e.g., ”👍”, “❤️”)

Protocol Definition

message ReactionEmoji {
  oneof emoji {
    string unicode_emoji = 1;
    // future compatibility
    // string custom_emoji  = 2;
  }
}
Custom emoji support is planned for future compatibility but not currently implemented.

Message Reactions

The MessageReactions message contains all reactions for a specific message.

MessageReactions

message_id
fixed64
required
Snowflake ID of the message
reaction_fields
MessageReactionField[]
required
Array of reaction fields, each representing a unique emoji and its data

Protocol Definition

message MessageReactions {
  // @snowflake<Message>
  fixed64 message_id = 1;
  repeated MessageReactionField reaction_fields = 2;
}

Message Reaction Field

Each MessageReactionField represents aggregated data for a specific emoji on a message.
emoji
ReactionEmoji
required
The emoji this field represents
count
uint32
required
Total number of users who reacted with this emoji
me
bool
required
Whether the current user has reacted with this emoji
preview_user_ids
fixed64[]
required
Array of user snowflake IDs showing a preview of users who reacted

Protocol Definition

message MessageReactionField {
  reactions.ReactionEmoji emoji = 1;
  uint32 count = 2;
  bool me = 3;

  // @snowflake<User>
  repeated fixed64 preview_user_ids = 4;
}

Example Usage

To add a thumbs up reaction to a message:
  1. Create an AddReaction message with the chat reference, message ID, and emoji
  2. The emoji field should contain a ReactionEmoji with unicode_emoji set to ”👍”
  3. Send the message to add the reaction
To remove the reaction, use RemoveReaction with the same parameters.

Build docs developers (and LLMs) love