From 02acefd6e28a334f16af952003270fa67cc4d477 Mon Sep 17 00:00:00 2001 From: MrMissx Date: Wed, 21 Jul 2021 23:06:55 +0700 Subject: [PATCH] Fix `AttributeError` when received `ChatForbidden` Signed-off-by: wulan17 --- 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 550b22b2..c8287cf9 100644 --- a/pyrogram/types/user_and_chats/chat.py +++ b/pyrogram/types/user_and_chats/chat.py @@ -379,7 +379,7 @@ class Chat(Object): @staticmethod def _parse_chat(client, chat: Union[raw.types.Chat, raw.types.User, raw.types.Channel]) -> "Chat": - if isinstance(chat, raw.types.Chat): + if isinstance(chat, (raw.types.Chat, raw.types.ChatForbidden)): return Chat._parse_chat_chat(client, chat) elif isinstance(chat, raw.types.User): return Chat._parse_user_chat(client, chat)