Skip to content

Commit abc84b8

Browse files
Add bound method Chat.unpin_all_messages (pyrogram#959)
1 parent 1c22577 commit abc84b8

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed

compiler/docs/compiler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ def get_title_list(s: str) -> list:
539539
Chat.leave
540540
Chat.mark_unread
541541
Chat.set_protected_content
542+
Chat.unpin_all_messages
542543
""",
543544
user="""
544545
User

pyrogram/types/user_and_chats/chat.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1047,3 +1047,23 @@ async def set_protected_content(self, enabled: bool) -> bool:
10471047
self.id,
10481048
enabled=enabled
10491049
)
1050+
1051+
async def unpin_all_messages(self) -> bool:
1052+
"""Bound method *unpin_all_messages* of :obj:`~pyrogram.types.Chat`.
1053+
1054+
Use as a shortcut for:
1055+
1056+
.. code-block:: python
1057+
1058+
client.unpin_all_chat_messages(chat_id)
1059+
1060+
Example:
1061+
.. code-block:: python
1062+
1063+
chat.unpin_all_messages()
1064+
1065+
Returns:
1066+
``bool``: On success, True is returned.
1067+
"""
1068+
1069+
return await self._client.unpin_all_chat_messages(self.id)

0 commit comments

Comments
 (0)