Skip to content

Commit b592fec

Browse files
committed
Update to Latest Commit
Sync to latest commit on the official repo https://github.com/Pyrogram/Pyrogram
1 parent c39d9d5 commit b592fec

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

compiler/api/compiler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,12 +361,14 @@ def start(format: bool = False):
361361

362362
for i, arg in enumerate(sorted_args):
363363
arg_name, arg_type = arg
364+
is_optional = FLAGS_RE.match(arg_type)
365+
flag_number = is_optional.group(1) if is_optional else -1
364366
arg_type = arg_type.split("?")[-1]
365367

366368
docstring_args.append(
367369
"{}{}: {}".format(
368370
arg_name,
369-
" (optional)",
371+
" (optional)".format(flag_number) if is_optional else "",
370372
get_docstring_arg_type(arg_type, is_pyrogram_type=c.namespace == "pyrogram")
371373
)
372374
)

compiler/docs/compiler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ def get_title_list(s: str) -> list:
543543
Chat.leave
544544
Chat.mark_unread
545545
Chat.set_protected_content
546+
Chat.unpin_all_messages
546547
""",
547548
user="""
548549
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)