-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Overview
Enable bot to react to messages and receive reactions from users. Lightweight feedback mechanism for quick acknowledgment.
Part of
Prerequisites
- Refactor: Adapter-agnostic core messaging interfaces cortex#57 (Core interfaces)
Changes
1. Outbox Enhancement (Bot adds reactions)
// In outbox payload
{
reactions: ["👍", "✅"] // Bot adds these emojis
}2. Inbox Enhancement (User reactions)
When user reacts to message:
{
metadata: {
type: "reaction",
reactionEmoji: "👍",
messageId: "out_abc123"
}
}3. Telegram Implementation
setMessageReactionAPI (Bot API 6.3+)- Handle
message_reactionupdates in getUpdates - Limited emoji set (Telegram restricts allowed reactions)
4. Database Changes
CREATE TABLE telegram_reactions (
message_id INTEGER NOT NULL,
chat_id INTEGER NOT NULL,
user_id INTEGER,
emoji TEXT NOT NULL,
created_at INTEGER NOT NULL,
PRIMARY KEY (message_id, chat_id, user_id, emoji)
);5. Multi-Adapter Support
| Adapter | Implementation |
|---|---|
| Telegram | setMessageReaction + message_reaction updates |
| Not supported (no equivalent) | |
| Web | Native reactions (future) |
| Voice | Not supported |
Use Cases
- Bot acknowledges: Bot reacts ⏳ while processing, then ✅ when done
- Quick feedback: User reacts 👍/👎 to bot suggestions
- Status tracking: Bot reactions indicate message state (pending/approved/rejected)
Files to Create
test/telegram-reactions.test.ts
Files to Update
src/db.ts- reactions tablesrc/telegram.ts- reaction sending and receiving
Acceptance Criteria
- Bot can add reactions to sent messages
- Bot receives user reactions as inbox entries
- Works with other features (buttons, replies)
- Duplicate reactions handled gracefully
- Tests cover bot→user and user→bot reaction flows
- Documentation includes allowed emoji list for Telegram
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request