From a667ba216a58710ffecf1a436c05b27e1c685d27 Mon Sep 17 00:00:00 2001 From: shokollm <270575765+shokollm@users.noreply.github.com> Date: Sat, 4 Apr 2026 23:07:58 +0000 Subject: [PATCH] refactor: simplify help command - Show only top-level commands without variations - Show admin-specific commands only to admins - Reduces cognitive overhead for normal users --- apps/telegram-bot/commands.py | 55 ++++++++++++++++++++--------------- 1 file changed, 31 insertions(+), 24 deletions(-) diff --git a/apps/telegram-bot/commands.py b/apps/telegram-bot/commands.py index 51f5990..6a4360f 100644 --- a/apps/telegram-bot/commands.py +++ b/apps/telegram-bot/commands.py @@ -695,27 +695,34 @@ async def cmd_admin(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> None: async def cmd_help(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> None: - await update.message.reply_text( - "👻 JIGAIDO Commands:\n\n" - "/bounty — list all bounties\n" - "/my — bounties you're tracking\n" - "/add [link] [due] — add bounty (admin only)\n" - "/update [text> [link] [due] — update bounty (admin only)\n" - "/edit [text> [link] [due] — edit bounty (same as update)\n" - " /edit -link [] — clear or set link\n" - " /edit -date [] — clear or set date\n" - "/delete [...] — delete bounty (admin only)\n" - "/track — track a bounty (groups only)\n" - "/untrack — stop tracking (groups only)\n" - "/show — show bounty details\n" - "/admin — list admins\n" - "/admin add @username — add admin (admin only)\n" - "/admin remove @username — remove admin (admin only)\n" - "/timezone — get room timezone\n" - "/timezone — set room timezone (admin only)\n" - "/recover — list recoverable bounties (admin only)\n" - "/recover [...] — recover bounty (admin only)\n" - "/start — re-initialize\n" - "/help — this message", - disable_web_page_preview=True, - ) + user_id = get_user_id(update) + room_id = get_room_id(update) + is_admin = BOUNTY_SERVICE.is_admin(room_id, user_id) + + lines = [ + "👻 JIGAIDO Commands:\n", + "/bounty — list bounties", + "/my — your tracked bounties", + "/add — add bounty", + "/edit — edit bounty", + "/delete — delete bounty", + "/track — track bounty", + "/untrack — stop tracking", + "/show — show bounty details", + "/admin — manage admins", + "/timezone — get/set timezone", + ] + + if is_admin: + lines.extend( + [ + "/recover — recover deleted bounties", + "/start — re-initialize", + ] + ) + else: + lines.append("/start — re-initialize") + + lines.append("/help — show this message") + + await update.message.reply_text("\n".join(lines), disable_web_page_preview=True)