mirror of
https://github.com/Rongronggg9/SlashBot.git
synced 2025-04-28 22:23:31 +08:00
mention id instead of username by default
This commit is contained in:
parent
ecf74e3bff
commit
cec0e557cd
@ -77,8 +77,8 @@ def mention(user: Dict[str, str]) -> str:
|
||||
|
||||
# Create user reference link
|
||||
username = user.get('username', '')
|
||||
uid = user.get('id', '')
|
||||
link = f'tg://resolve?domain={username}' if username else f'tg://user?id={uid}'
|
||||
uid = user.get('id', -1)
|
||||
link = f'tg://resolve?domain={username}' if (username and uid < 0) else f'tg://user?id={uid}'
|
||||
|
||||
return f"[{name}]({link})"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user