From bd46ff39772ada7a80e90ba8e00f700b8f6c05af Mon Sep 17 00:00:00 2001 From: Yasir Aris M Date: Fri, 20 Dec 2024 17:18:14 +0700 Subject: [PATCH] pyrofork: Add message_thread_id parameter to unpin_all_chat_messages() Signed-off-by: Yasir Aris M --- pyrogram/methods/chats/unpin_all_chat_messages.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/pyrogram/methods/chats/unpin_all_chat_messages.py b/pyrogram/methods/chats/unpin_all_chat_messages.py index fe34bb14..ad0b0b7d 100644 --- a/pyrogram/methods/chats/unpin_all_chat_messages.py +++ b/pyrogram/methods/chats/unpin_all_chat_messages.py @@ -27,6 +27,7 @@ class UnpinAllChatMessages: async def unpin_all_chat_messages( self: "pyrogram.Client", chat_id: Union[int, str], + message_thread_id: int = None, ) -> bool: """Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have @@ -39,6 +40,9 @@ class UnpinAllChatMessages: Unique identifier (int) or username (str) of the target chat. You can also use chat public link in form of *t.me/* (str). + message_thread_id (``int``, *optional*): + Unique identifier for the target message thread of the forum topic + Returns: ``bool``: True on success. @@ -48,10 +52,10 @@ class UnpinAllChatMessages: # Unpin all chat messages await app.unpin_all_chat_messages(chat_id) """ - await self.invoke( + r = await self.invoke( raw.functions.messages.UnpinAllMessages( - peer=await self.resolve_peer(chat_id) + peer=await self.resolve_peer(chat_id), + top_msg_id=message_thread_id ) ) - - return True + return r.pts_count