mirror of
https://github.com/pyrogram/pyrogram
synced 2025-08-22 09:57:19 +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
3b0dee7dd5
commit
2de8f1921c
@ -487,7 +487,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…
x
Reference in New Issue
Block a user