feat(telegram): add bidirectional emoji reactions support #964
+3,012
−24
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Adds bidirectional Telegram reaction support: users' reactions are now visible to Clawdbot via system events, and Clawdbot can react to messages with configurable behavior levels.
Changes
Reaction Notifications (User → Agent)
channels.telegram.reactionNotificationscontrols visibility"off"— ignore all reactions (default)"all"— notify agent of all reactionsmessage_reactionevents convert to system events with format:"Telegram reaction added: {emoji} by {user} on msg {id}"Agent Reactions (Agent → User)
channels.telegram.reactionLevelcontrols agent capability"off"— agent cannot react"ack"— bot sends acknowledgment reactions (👀 while processing)"minimal"— agent can react sparingly (guideline: 1 per 5-10 exchanges)"extensive"— agent can react liberallyreactionLeveland existingactions.reactionsInfrastructure
src/telegram/sent-message-cache.ts): tracks bot's own messages to distinguish from user messagessrc/telegram/reaction-level.ts): determines effective capabilities and guidancemessage_thread_idfor correct session routingDocumentation
docs/channels/telegram.mdallowed_updates)Test Coverage
src/telegram/bot.test.ts— 80+ new test cases for reaction event handlingsrc/telegram/reaction-level.test.ts— reaction level resolution logicsrc/telegram/sent-message-cache.test.ts— message trackingsrc/agents/tools/telegram-actions.test.ts— updated for reaction level gatingMigration Notes
actions.reactionsgating still respected🤖 Generated with Claude Code