From 9b28a120e2a70711446b9c0489a596b9f3be66b8 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Fri, 17 Dec 2021 11:49:53 +0100 Subject: [PATCH] Fix megagroup attribute on ChatForbidden objects --- pyrogram/types/user_and_chats/chat.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyrogram/types/user_and_chats/chat.py b/pyrogram/types/user_and_chats/chat.py index cf607c66..4042c073 100644 --- a/pyrogram/types/user_and_chats/chat.py +++ b/pyrogram/types/user_and_chats/chat.py @@ -221,7 +221,7 @@ class Chat(Object): return Chat( id=peer_id, - type="supergroup" if channel.megagroup else "channel", + type="supergroup" if getattr(channel, "megagroup", None) else "channel", is_verified=getattr(channel, "verified", None), is_restricted=getattr(channel, "restricted", None), is_creator=getattr(channel, "creator", None),