feat: use HTML parse mode for user link in /show

Now using <a href="tg://user?id=XXX">User</a> with HTML parse mode
for clickable user link without pinging.
This commit is contained in:
shokollm
2026-04-05 01:28:07 +00:00
parent 17b022fc6c
commit db1369c004

View File

@@ -10,6 +10,7 @@ import dateparser
from telegram import Update
from telegram.ext import ContextTypes
from telegram import InlineKeyboardButton, InlineKeyboardMarkup
from telegram.constants import ParseMode
from adapters.storage.json_file import JsonFileRoomStorage, JsonFileTrackingStorage
from core.services import BountyService, TrackingService
@@ -661,13 +662,15 @@ async def cmd_show(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> None:
due_str = dt_due.strftime("%d %B %Y %H:%M")
lines.append(f"📅 {due_str} ({timezone_str})")
lines.append(f"👤 [User](tg://user?id={bounty.created_by_user_id})")
lines.append(f'👤 <a href="tg://user?id={bounty.created_by_user_id}">User</a>')
dt_created = datetime.fromtimestamp(bounty.created_at, tz=tz)
created_str = dt_created.strftime("%Y-%m-%d %H:%M")
lines.append(f"📌 Created: {created_str}")
await update.message.reply_text("\n".join(lines), disable_web_page_preview=True)
await update.message.reply_text(
"\n".join(lines), disable_web_page_preview=True, parse_mode=ParseMode.HTML
)
async def cmd_timezone(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> None: