mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 12:04:51 +00:00
Update chat username parsing in case of multiple usernames
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
3163030574
commit
8940c7d1f6
1 changed files with 5 additions and 1 deletions
|
|
@ -478,7 +478,11 @@ class Client(Methods):
|
|||
elif isinstance(peer, (raw.types.Channel, raw.types.ChannelForbidden)):
|
||||
peer_id = utils.get_channel_id(peer.id)
|
||||
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"
|
||||
else:
|
||||
continue
|
||||
|
|
|
|||
Loading…
Reference in a new issue