mirror of
https://github.com/TeamPGM/pyrogram.git
synced 2024-11-30 17:43:32 +00:00
Update chat username parsing in case of multiple usernames
This commit is contained in:
parent
d6476ce57e
commit
a3a4a0204c
@ -513,7 +513,11 @@ class Client(Methods):
|
|||||||
elif isinstance(peer, (raw.types.Channel, raw.types.ChannelForbidden)):
|
elif isinstance(peer, (raw.types.Channel, raw.types.ChannelForbidden)):
|
||||||
peer_id = utils.get_channel_id(peer.id)
|
peer_id = utils.get_channel_id(peer.id)
|
||||||
access_hash = peer.access_hash
|
access_hash = peer.access_hash
|
||||||
username = (getattr(peer, "username", None) or "").lower() or None
|
username = (
|
||||||
|
peer.username.lower() if peer.username
|
||||||
|
else peer.usernames[0].username.lower() if peer.usernames
|
||||||
|
else None
|
||||||
|
)
|
||||||
peer_type = "channel" if peer.broadcast else "supergroup"
|
peer_type = "channel" if peer.broadcast else "supergroup"
|
||||||
else:
|
else:
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user