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:
@@ -803,11 +803,16 @@ async def cmd_admin(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> None:
|
|||||||
for admin_id in admins:
|
for admin_id in admins:
|
||||||
username = _find_username_by_user_id(get_room_id(update), admin_id)
|
username = _find_username_by_user_id(get_room_id(update), admin_id)
|
||||||
if username:
|
if username:
|
||||||
admin_mentions.append(f"@{username}")
|
admin_mentions.append(
|
||||||
|
f'<a href="tg://user?id={admin_id}">@{username}</a>'
|
||||||
|
)
|
||||||
else:
|
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(
|
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
|
return
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user