Telegram — React to a message
Input
emoji requiredThe reaction emoji as a character, e.g. "❤", "🔥", "😭". It must already appear as a reaction on the target message; the script tells you which emojis qualify when it does not. Resolved through Telegram's own reactions table, so it is matched by identity rather than by any translated emoji name.
peerId requiredThe conversation's peer id, as returned by get_inbox (negative ids are channels and groups). Saved Messages is refused — see the description.
messageId requiredThe message to react to, as returned by get_conversation. Must be in the recently loaded window of that conversation.
remove optionalLeave false (the default) to add your reaction. Set true to take your own reaction back. Both are the same toggle in Telegram, which is why this is a flag rather than a second script.
Default: falseOutput
emoji requiredThe emoji that was reacted with.
peerId requiredThe peer id that was actually opened, read back from the address bar.
changed requiredTrue when this run actually flipped your reaction. False means it was already in the requested state and nothing was clicked.
messageId requiredThe message that was acted on.
reactedNow requiredWhether your reaction is on the message after this ran, read back from the pill's chosen state rather than assumed from the click.
account_used requiredThe account that reacted, read from the app's own account menu rather than assumed from the request. Null if the menu did not expose a name.
already_in_state requiredTrue when your reaction was already present (or already absent) before this ran, so the request was a no-op.
verified_on_page requiredTrue when the resulting state was confirmed by the pill's chosen state on the page, rather than assumed from the click.
chatTitle optionalThe conversation title from the header — echo this to a human, since a peer id is not recognisable.
countAfter optionalThe reaction's total count afterwards, read from the pill this script clicked once it settled. Null only when that pill is gone entirely, which happens when you removed the last reaction of that type. On a busy channel other people react at the same time, so treat the delta as indicative and reactedNow as authoritative.
emojiTitle optionalTelegram's own name for that emoji, taken from its reactions table (e.g. "Red Heart" for ❤). This is how the script located the right reaction pill without depending on a hardcoded label.
countBefore optionalThe reaction's total count before the click, as Telegram rendered it.
replacedEmoji optionalThe emoji whose reaction this displaced, or null if none. Telegram allows only one reaction per message on a standard account, so adding one SILENTLY removes the one you had before — this field makes that visible instead of leaving the caller to discover it. Always null when removing.
availableOnMessage optionalThe emojis that currently have a reaction group on this message, which are the ones this script can act on.
