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:
@@ -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:
|
async def cmd_help(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> None:
|
||||||
await update.message.reply_text(
|
user_id = get_user_id(update)
|
||||||
"👻 JIGAIDO Commands:\n\n"
|
room_id = get_room_id(update)
|
||||||
"/bounty — list all bounties\n"
|
is_admin = BOUNTY_SERVICE.is_admin(room_id, user_id)
|
||||||
"/my — bounties you're tracking\n"
|
|
||||||
"/add <text> [link] [due] — add bounty (admin only)\n"
|
lines = [
|
||||||
"/update <id> [text> [link] [due] — update bounty (admin only)\n"
|
"👻 JIGAIDO Commands:\n",
|
||||||
"/edit <id> [text> [link] [due] — edit bounty (same as update)\n"
|
"/bounty — list bounties",
|
||||||
" /edit <id> -link [<url>] — clear or set link\n"
|
"/my — your tracked bounties",
|
||||||
" /edit <id> -date [<date>] — clear or set date\n"
|
"/add — add bounty",
|
||||||
"/delete <id> [<id>...] — delete bounty (admin only)\n"
|
"/edit — edit bounty",
|
||||||
"/track <id> — track a bounty (groups only)\n"
|
"/delete — delete bounty",
|
||||||
"/untrack <id> — stop tracking (groups only)\n"
|
"/track — track bounty",
|
||||||
"/show <id> — show bounty details\n"
|
"/untrack — stop tracking",
|
||||||
"/admin — list admins\n"
|
"/show — show bounty details",
|
||||||
"/admin add @username — add admin (admin only)\n"
|
"/admin — manage admins",
|
||||||
"/admin remove @username — remove admin (admin only)\n"
|
"/timezone — get/set timezone",
|
||||||
"/timezone — get room timezone\n"
|
]
|
||||||
"/timezone <tz> — set room timezone (admin only)\n"
|
|
||||||
"/recover — list recoverable bounties (admin only)\n"
|
if is_admin:
|
||||||
"/recover <id> [<id>...] — recover bounty (admin only)\n"
|
lines.extend(
|
||||||
"/start — re-initialize\n"
|
[
|
||||||
"/help — this message",
|
"/recover — recover deleted bounties",
|
||||||
disable_web_page_preview=True,
|
"/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)
|
||||||
|
|||||||
Reference in New Issue
Block a user