2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-23 10:28:00 +00:00

Add bound method Chat.unpin_all_messages (#959)

This commit is contained in:
Stark Programmer 2022-04-16 22:03:26 +05:30 committed by GitHub
parent 1c225776c9
commit abc84b829a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 0 deletions

View File

@ -539,6 +539,7 @@ def pyrogram_api():
Chat.leave
Chat.mark_unread
Chat.set_protected_content
Chat.unpin_all_messages
""",
user="""
User

View File

@ -1047,3 +1047,23 @@ class Chat(Object):
self.id,
enabled=enabled
)
async def unpin_all_messages(self) -> bool:
"""Bound method *unpin_all_messages* of :obj:`~pyrogram.types.Chat`.
Use as a shortcut for:
.. code-block:: python
client.unpin_all_chat_messages(chat_id)
Example:
.. code-block:: python
chat.unpin_all_messages()
Returns:
``bool``: On success, True is returned.
"""
return await self._client.unpin_all_chat_messages(self.id)