There was an error while loading. Please reload this page.
1 parent 6e3d8ca commit 34616ebCopy full SHA for 34616eb
2 files changed
docs/source/api/bound-methods.rst
@@ -68,6 +68,15 @@ Chat
68
- :meth:`~Chat.archive`
69
- :meth:`~Chat.unarchive`
70
71
+User
72
+^^^^
73
+
74
+.. hlist::
75
+ :columns: 2
76
77
+ - :meth:`~User.archive`
78
+ - :meth:`~User.unarchive`
79
80
CallbackQuery
81
^^^^^^^^^^^^^
82
@@ -122,6 +131,10 @@ Details
122
131
.. automethod:: Chat.archive()
123
132
.. automethod:: Chat.unarchive()
124
133
134
+.. User
135
+.. automethod:: User.archive()
136
+.. automethod:: User.unarchive()
137
125
138
.. CallbackQuery
126
139
.. automethod:: CallbackQuery.answer()
127
140
pyrogram/client/types/user_and_chats/user.py
@@ -160,3 +160,49 @@ def _parse(client, user: types.User) -> "User" or None:
160
restriction_reason=user.restriction_reason,
161
client=client
162
)
163
164
+ def archive(self):
165
+ """Bound method *archive* of :obj:`User`.
166
167
+ Use as a shortcut for:
168
169
+ .. code-block:: python
170
171
+ client.archive_chats(123456789)
172
173
+ Example:
174
175
176
+ user.archive()
177
178
+ Returns:
179
+ True on success.
180
181
+ Raises:
182
+ RPCError: In case of a Telegram RPC error.
183
+ """
184
185
+ return self._client.archive_chats(self.id)
186
187
+ def unarchive(self):
188
+ """Bound method *unarchive* of :obj:`User`.
189
190
191
192
193
194
+ client.unarchive_chats(123456789)
195
196
197
198
199
+ user.unarchive()
200
201
202
203
204
205
206
207
208
+ return self._client.unarchive_chats(self.id)
0 commit comments