Fix AttributeError when received ChatForbidden

Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
MrMissx 2021-07-21 23:06:55 +07:00 committed by wulan17
parent 86621ba836
commit 02acefd6e2
No known key found for this signature in database
GPG key ID: 318CD6CD3A6AC0A5

View file

@ -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)