pyrofork: Add message_thread_id parameter to unpin_all_chat_messages()

Signed-off-by: Yasir Aris M <git@yasirdev.my.id>
This commit is contained in:
Yasir Aris M 2024-12-20 17:18:14 +07:00 committed by Yasir
parent b21db6f931
commit bd46ff3977

View file

@ -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/<username>* (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