From 8a08dcb92a63cb27fb71df1812c57cb71319ccc5 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Wed, 8 Dec 2021 07:43:02 +0100 Subject: [PATCH] Update UserFull according to the new schema --- pyrogram/types/user_and_chats/chat.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pyrogram/types/user_and_chats/chat.py b/pyrogram/types/user_and_chats/chat.py index 59db7a62..40bf2023 100644 --- a/pyrogram/types/user_and_chats/chat.py +++ b/pyrogram/types/user_and_chats/chat.py @@ -266,15 +266,15 @@ class Chat(Object): return Chat._parse_channel_chat(client, chats[peer.channel_id]) @staticmethod - async def _parse_full(client, chat_full: Union[raw.types.messages.ChatFull, raw.types.UserFull]) -> "Chat": - if isinstance(chat_full, raw.types.UserFull): - parsed_chat = Chat._parse_user_chat(client, chat_full.user) - parsed_chat.bio = chat_full.about + async def _parse_full(client, chat_full: Union[raw.types.messages.ChatFull, raw.types.users.UserFull]) -> "Chat": + if isinstance(chat_full, raw.types.users.UserFull): + parsed_chat = Chat._parse_user_chat(client, chat_full.users[0]) + parsed_chat.bio = chat_full.full_user.about - if chat_full.pinned_msg_id: + if chat_full.full_user.pinned_msg_id: parsed_chat.pinned_message = await client.get_messages( parsed_chat.id, - message_ids=chat_full.pinned_msg_id + message_ids=chat_full.full_user.pinned_msg_id ) else: full_chat = chat_full.full_chat