Skip to content

Commit 9b28a12

Browse files
committed
Fix megagroup attribute on ChatForbidden objects
1 parent bf9e186 commit 9b28a12

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • pyrogram/types/user_and_chats

pyrogram/types/user_and_chats/chat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def _parse_channel_chat(client, channel: raw.types.Channel) -> "Chat":
221221

222222
return Chat(
223223
id=peer_id,
224-
type="supergroup" if channel.megagroup else "channel",
224+
type="supergroup" if getattr(channel, "megagroup", None) else "channel",
225225
is_verified=getattr(channel, "verified", None),
226226
is_restricted=getattr(channel, "restricted", None),
227227
is_creator=getattr(channel, "creator", None),

0 commit comments

Comments
 (0)