Fix user mentions for deleted accounts

This commit is contained in:
Dan 2022-04-24 11:56:07 +02:00
parent 124bcb4db7
commit 6fa4cdff15

View File

@ -195,7 +195,11 @@ class User(Object, Update):
@property @property
def mention(self): def mention(self):
return Link(f"tg://user?id={self.id}", self.first_name, self._client.parse_mode) return Link(
f"tg://user?id={self.id}",
self.first_name or "Deleted Account",
self._client.parse_mode
)
@staticmethod @staticmethod
def _parse(client, user: "raw.base.User") -> Optional["User"]: def _parse(client, user: "raw.base.User") -> Optional["User"]: