mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-01 13:14:52 +00:00
Add .archive() and .unarchive() bound methods to User
This commit is contained in:
parent
6e3d8ca20b
commit
34616ebf61
2 changed files with 59 additions and 0 deletions
|
|
@ -68,6 +68,15 @@ Chat
|
|||
- :meth:`~Chat.archive`
|
||||
- :meth:`~Chat.unarchive`
|
||||
|
||||
User
|
||||
^^^^
|
||||
|
||||
.. hlist::
|
||||
:columns: 2
|
||||
|
||||
- :meth:`~User.archive`
|
||||
- :meth:`~User.unarchive`
|
||||
|
||||
CallbackQuery
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
|
|
@ -122,6 +131,10 @@ Details
|
|||
.. automethod:: Chat.archive()
|
||||
.. automethod:: Chat.unarchive()
|
||||
|
||||
.. User
|
||||
.. automethod:: User.archive()
|
||||
.. automethod:: User.unarchive()
|
||||
|
||||
.. CallbackQuery
|
||||
.. automethod:: CallbackQuery.answer()
|
||||
|
||||
|
|
|
|||
|
|
@ -160,3 +160,49 @@ class User(Object):
|
|||
restriction_reason=user.restriction_reason,
|
||||
client=client
|
||||
)
|
||||
|
||||
def archive(self):
|
||||
"""Bound method *archive* of :obj:`User`.
|
||||
|
||||
Use as a shortcut for:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
client.archive_chats(123456789)
|
||||
|
||||
Example:
|
||||
.. code-block:: python
|
||||
|
||||
user.archive()
|
||||
|
||||
Returns:
|
||||
True on success.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
"""
|
||||
|
||||
return self._client.archive_chats(self.id)
|
||||
|
||||
def unarchive(self):
|
||||
"""Bound method *unarchive* of :obj:`User`.
|
||||
|
||||
Use as a shortcut for:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
client.unarchive_chats(123456789)
|
||||
|
||||
Example:
|
||||
.. code-block:: python
|
||||
|
||||
user.unarchive()
|
||||
|
||||
Returns:
|
||||
True on success.
|
||||
|
||||
Raises:
|
||||
RPCError: In case of a Telegram RPC error.
|
||||
"""
|
||||
|
||||
return self._client.unarchive_chats(self.id)
|
||||
|
|
|
|||
Loading…
Reference in a new issue