Skip to content

Commit 22a7e33

Browse files
committed
Fetch the pinned message in own chat (saved messages)
1 parent 4661fb0 commit 22a7e33

File tree

1 file changed

+6
-0
lines changed
  • pyrogram/client/types/user_and_chats

1 file changed

+6
-0
lines changed

pyrogram/client/types/user_and_chats/chat.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ def _parse_full(client, chat_full: types.messages.ChatFull or types.UserFull) ->
185185
if isinstance(chat_full, types.UserFull):
186186
parsed_chat = Chat._parse_user_chat(client, chat_full.user)
187187
parsed_chat.description = chat_full.about
188+
189+
if chat_full.pinned_msg_id:
190+
parsed_chat.pinned_message = client.get_messages(
191+
parsed_chat.id,
192+
message_ids=chat_full.pinned_msg_id
193+
)
188194
else:
189195
full_chat = chat_full.full_chat
190196
chat = None

0 commit comments

Comments
 (0)