fix: only show user in /show if username is stored

Now only shows the creator line if created_by_username exists,
no fallback to "User {id}" which could be confusing.
This commit is contained in:
shokollm
2026-04-05 01:39:29 +00:00
parent a1946e4c4e
commit 8cc7b09716

View File

@@ -666,10 +666,10 @@ async def cmd_show(update: Update, ctx: ContextTypes.DEFAULT_TYPE) -> None:
due_str = dt_due.strftime("%d %B %Y %H:%M") due_str = dt_due.strftime("%d %B %Y %H:%M")
lines.append(f"📅 {due_str} ({timezone_str})") lines.append(f"📅 {due_str} ({timezone_str})")
display_name = bounty.created_by_username or f"User {bounty.created_by_user_id}" if bounty.created_by_username:
lines.append( lines.append(
f'👤 <a href="tg://user?id={bounty.created_by_user_id}">{display_name}</a>' f'👤 <a href="tg://user?id={bounty.created_by_user_id}">{bounty.created_by_username}</a>'
) )
dt_created = datetime.fromtimestamp(bounty.created_at, tz=tz) dt_created = datetime.fromtimestamp(bounty.created_at, tz=tz)
created_str = dt_created.strftime("%Y-%m-%d %H:%M") created_str = dt_created.strftime("%Y-%m-%d %H:%M")