From a1323e0d1d93fe95faf3ed4082ea3fc7533ae56e Mon Sep 17 00:00:00 2001 From: viettranx Date: Thu, 2 Apr 2026 12:02:12 +0700 Subject: [PATCH] feat(telegram): remap reaction emojis and add /reactions command MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remap status reaction emojis for clarity (tool: 🔥→✍, error: 😱→💔) and reduce overlap between statuses. Add /reactions command to show emoji legend table to users. --- internal/channels/telegram/commands.go | 13 +++++++++++ internal/channels/telegram/reactions.go | 31 +++++++++++++++++++------ 2 files changed, 37 insertions(+), 7 deletions(-) diff --git a/internal/channels/telegram/commands.go b/internal/channels/telegram/commands.go index 3ab75c7d..103ee1f8 100644 --- a/internal/channels/telegram/commands.go +++ b/internal/channels/telegram/commands.go @@ -85,6 +85,7 @@ func (c *Channel) handleBotCommand(ctx context.Context, message *telego.Message, "/stopall — Stop all running tasks\n" + "/reset — Reset conversation history\n" + "/status — Show bot status\n" + + "/reactions — Show reaction emoji legend\n" + "/tasks — List team tasks\n" + "/task_detail — View task detail\n" + "/subagents — List subagent tasks\n" + @@ -226,6 +227,18 @@ func (c *Channel) handleBotCommand(ctx context.Context, message *telego.Message, case "/writers": c.handleListWriters(ctx, chatID, chatIDStr, isGroup, setThread) return true + + case "/reactions": + var lines string + for _, r := range reactionLegend { + lines += fmt.Sprintf("%s %s\n", r.Emoji, r.Desc) + } + reactText := fmt.Sprintf("Reaction Emoji Legend\n\n
%s
\nReaction level: %s", lines, c.config.ReactionLevel) + msg := tu.Message(chatIDObj, reactText) + msg.ParseMode = telego.ModeHTML + setThread(msg) + c.bot.SendMessage(ctx, msg) + return true } return false diff --git a/internal/channels/telegram/reactions.go b/internal/channels/telegram/reactions.go index d6b1e2fa..9f745b47 100644 --- a/internal/channels/telegram/reactions.go +++ b/internal/channels/telegram/reactions.go @@ -41,15 +41,32 @@ var telegramSupportedEmojis = map[string]bool{ // First emoji is preferred; fallback to next if chat restricts it. // Ref: TS src/telegram/status-reaction-variants.ts var statusReactionVariants = map[string][]string{ - "queued": {"👀", "👍", "🔥"}, + "queued": {"👀", "🙏", "🤝"}, "thinking": {"🤔", "🤓", "👀"}, - "tool": {"🔥", "⚡", "👍"}, - "coding": {"👨\u200d💻", "🔥", "⚡"}, - "web": {"⚡", "🔥", "👍"}, + "tool": {"✍", "⚡", "🔥"}, + "coding": {"👨\u200d💻", "✍", "🤓"}, + "web": {"⚡", "🌚", "🔥"}, "done": {"👍", "🎉", "💯"}, - "error": {"😱", "😨", "🤯"}, - "stallSoft": {"🥱", "😴", "🤔"}, - "stallHard": {"😨", "😱", "⚡"}, + "error": {"💔", "😱", "😨"}, + "stallSoft": {"🥱", "😴", "😐"}, + "stallHard": {"😨", "🤯", "😱"}, +} + +// ReactionLegend returns the primary emoji for each status, used by the /reactions command. +var reactionLegend = []struct { + Status string + Emoji string + Desc string +}{ + {"queued", "👀", "Queued — waiting to process"}, + {"thinking", "🤔", "Thinking — processing your request"}, + {"tool", "✍", "Tool — executing a tool"}, + {"coding", "👨\u200d💻", "Coding — running code"}, + {"web", "⚡", "Web — browsing / API call"}, + {"done", "👍", "Done — completed"}, + {"error", "💔", "Error — something went wrong"}, + {"stallSoft", "🥱", "Stall — no activity for 10s"}, + {"stallHard", "😨", "Stall — no activity for 30s"}, } // resolveReactionEmoji picks the first supported emoji for a given status.