Skip to content

Commit 6fa4cdf

Browse files
committed
Fix user mentions for deleted accounts
1 parent 124bcb4 commit 6fa4cdf

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

  • pyrogram/types/user_and_chats

pyrogram/types/user_and_chats/user.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,11 @@ def __init__(
195195

196196
@property
197197
def mention(self):
198-
return Link(f"tg://user?id={self.id}", self.first_name, self._client.parse_mode)
198+
return Link(
199+
f"tg://user?id={self.id}",
200+
self.first_name or "Deleted Account",
201+
self._client.parse_mode
202+
)
199203

200204
@staticmethod
201205
def _parse(client, user: "raw.base.User") -> Optional["User"]:

0 commit comments

Comments
 (0)