feat: use HTML links for admin list

Now /admin shows usernames as clickable tg://user?id= links,
same format as /show command. Uses HTML parse mode.
This commit is contained in:
shokollm
2026-04-05 02:26:10 +00:00
parent 1bde18589c
commit 1db8e48414

View File

@@ -803,11 +803,16 @@ async def cmd_admin(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> None:
for admin_id in admins:
username = _find_username_by_user_id(get_room_id(update), admin_id)
if username:
admin_mentions.append(f"@{username}")
admin_mentions.append(
f'<a href="tg://user?id={admin_id}">@{username}</a>'
)
else:
admin_mentions.append(f"user#{admin_id}")
admin_mentions.append(
f'<a href="tg://user?id={admin_id}">{admin_id}</a>'
)
await update.message.reply_text(
f"Room Admins:\n" + "\n".join(f"- {m}" for m in admin_mentions)
f"Room Admins:\n" + "\n".join(f"- {m}" for m in admin_mentions),
parse_mode=ParseMode.HTML,
)
return