diff --git a/pyrogram/client.py b/pyrogram/client.py index 9de55621..f213c57a 100644 --- a/pyrogram/client.py +++ b/pyrogram/client.py @@ -513,7 +513,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