livqenoDocs

ChatReactions

Reactions

Add and remove emoji reactions. Safe to tap twice, and already grouped for you.

Reactions let users respond to a message with an emoji, like 👍 or 🎉, without sending a new message. They're great for quick "got it" replies in support chat, or voting in a team channel.

Where this fits: your app is connected to a conversation and shows messages. A reaction is attached to one message, and comes back as part of that message's data.

Use it

In your app:

await chat.messages.addReaction('msg_3xR…', '👍');
await chat.messages.removeReaction('msg_3xR…', '👍');
 
chat.on('reactionAdded', (event) => {
  console.log(`${event.userId} reacted ${event.emoji}`);
});

Everyone in the conversation gets a reactionAdded or reactionRemoved event, so counts update live.

Safe to repeat

  • Adding the same reaction twice does nothing the second time. No duplicate.
  • Removing a reaction that isn't there still succeeds.

So a double-tap on a slow network is harmless. Each user can have one of each emoji per message. A user can add 👍 and 🎉 to the same message.

Grouped, not raw

Each message comes with its reactions already grouped by emoji:

"reactions": [
  { "emoji": "👍", "count": 3, "userIds": ["alice", "bob", "carol"] },
  { "emoji": "🎉", "count": 1, "userIds": ["dave"] }
]
  • Show "👍 3" straight from count.
  • Use userIds to show "you reacted" or a tooltip of names. No extra request needed.

Limits

LimitValue
Reactions per message200
Length of one reaction32 characters (enough for any emoji, even 👨‍👩‍👧‍👦)

Livqeno doesn't check that a reaction is a real emoji. You can use custom reactions, shortcodes like :shipit:, or image keys.

Common errors

ProblemCauseFix
A second reaction doesn't show upAdding the same (message, user, emoji) again does nothing.This is expected. Treat it as success.
INVALID_MESSAGE / validation errorThe reaction is longer than 32 characters.Limit custom shortcode length in your app.
Counts drift after a reconnectYour app keeps its own count from events.Use the message's reactions array as the source of truth.

Production tips

  • Show reactions from the message's reactions array. Don't keep your own count; a reconnect could replay events and double it.
  • Disable the reaction button while its call is running (in React, use pending from useReactions()).
  • Reactions don't count toward your free message allowance.

Next steps