From 22a7e338ff418f57d12ace8ca4f650a2e02c8f4c Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Sun, 14 Apr 2019 20:18:44 +0200 Subject: [PATCH] Fetch the pinned message in own chat (saved messages) --- pyrogram/client/types/user_and_chats/chat.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyrogram/client/types/user_and_chats/chat.py b/pyrogram/client/types/user_and_chats/chat.py index a13f8a2b..1d4369d4 100644 --- a/pyrogram/client/types/user_and_chats/chat.py +++ b/pyrogram/client/types/user_and_chats/chat.py @@ -185,6 +185,12 @@ class Chat(PyrogramType): if isinstance(chat_full, types.UserFull): parsed_chat = Chat._parse_user_chat(client, chat_full.user) parsed_chat.description = chat_full.about + + if chat_full.pinned_msg_id: + parsed_chat.pinned_message = client.get_messages( + parsed_chat.id, + message_ids=chat_full.pinned_msg_id + ) else: full_chat = chat_full.full_chat chat = None