refactor: simplify help command

- Show only top-level commands without variations
- Show admin-specific commands only to admins
- Reduces cognitive overhead for normal users
This commit is contained in:
shokollm
2026-04-04 23:07:58 +00:00
parent badb2e3292
commit a667ba216a

View File

@@ -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 <text> [link] [due] — add bounty (admin only)\n"
"/update <id> [text> [link] [due] — update bounty (admin only)\n"
"/edit <id> [text> [link] [due] — edit bounty (same as update)\n"
" /edit <id> -link [<url>] — clear or set link\n"
" /edit <id> -date [<date>] — clear or set date\n"
"/delete <id> [<id>...] — delete bounty (admin only)\n"
"/track <id> — track a bounty (groups only)\n"
"/untrack <id> — stop tracking (groups only)\n"
"/show <id> — 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 <tz> — set room timezone (admin only)\n"
"/recover — list recoverable bounties (admin only)\n"
"/recover <id> [<id>...] — 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)