mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Fix resolving peers for users with multiple usernames
This currently makes it work for the first available username only
This commit is contained in:
parent
3c0e86a167
commit
64177b533c
1 changed files with 5 additions and 1 deletions
|
|
@ -464,7 +464,11 @@ class Client(Methods):
|
|||
if isinstance(peer, raw.types.User):
|
||||
peer_id = peer.id
|
||||
access_hash = peer.access_hash
|
||||
username = (peer.username or "").lower() or None
|
||||
username = (
|
||||
peer.username.lower() if peer.username
|
||||
else peer.usernames[0].username.lower() if peer.usernames
|
||||
else None
|
||||
)
|
||||
phone_number = peer.phone
|
||||
peer_type = "bot" if peer.bot else "user"
|
||||
elif isinstance(peer, (raw.types.Chat, raw.types.ChatForbidden)):
|
||||
|
|
|
|||
Loading…
Reference in a new issue