mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-04 22:34:52 +00:00
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:
parent
b21db6f931
commit
bd46ff3977
1 changed files with 8 additions and 4 deletions
|
|
@ -27,6 +27,7 @@ class UnpinAllChatMessages:
|
||||||
async def unpin_all_chat_messages(
|
async def unpin_all_chat_messages(
|
||||||
self: "pyrogram.Client",
|
self: "pyrogram.Client",
|
||||||
chat_id: Union[int, str],
|
chat_id: Union[int, str],
|
||||||
|
message_thread_id: int = None,
|
||||||
) -> bool:
|
) -> bool:
|
||||||
"""Use this method to clear the list of pinned messages in a chat.
|
"""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
|
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.
|
Unique identifier (int) or username (str) of the target chat.
|
||||||
You can also use chat public link in form of *t.me/<username>* (str).
|
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:
|
Returns:
|
||||||
``bool``: True on success.
|
``bool``: True on success.
|
||||||
|
|
||||||
|
|
@ -48,10 +52,10 @@ class UnpinAllChatMessages:
|
||||||
# Unpin all chat messages
|
# Unpin all chat messages
|
||||||
await app.unpin_all_chat_messages(chat_id)
|
await app.unpin_all_chat_messages(chat_id)
|
||||||
"""
|
"""
|
||||||
await self.invoke(
|
r = await self.invoke(
|
||||||
raw.functions.messages.UnpinAllMessages(
|
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 r.pts_count
|
||||||
return True
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue