File tree Expand file tree Collapse file tree
pyrogram/client/types/user_and_chats Expand file tree Collapse file tree Original file line number Diff line number Diff line change 6868 - :meth: `~Chat.archive `
6969 - :meth: `~Chat.unarchive `
7070
71+ User
72+ ^^^^
73+
74+ .. hlist ::
75+ :columns: 2
76+
77+ - :meth: `~User.archive `
78+ - :meth: `~User.unarchive `
79+
7180CallbackQuery
7281^^^^^^^^^^^^^
7382
@@ -122,6 +131,10 @@ Details
122131 .. automethod :: Chat.archive()
123132.. automethod :: Chat.unarchive()
124133
134+ .. User
135+ .. automethod :: User.archive()
136+ .. automethod :: User.unarchive()
137+
125138.. CallbackQuery
126139 .. automethod :: CallbackQuery.answer()
127140
Original file line number Diff line number Diff line change @@ -160,3 +160,49 @@ def _parse(client, user: types.User) -> "User" or None:
160160 restriction_reason = user .restriction_reason ,
161161 client = client
162162 )
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+ .. code-block:: python
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+ Use as a shortcut for:
191+
192+ .. code-block:: python
193+
194+ client.unarchive_chats(123456789)
195+
196+ Example:
197+ .. code-block:: python
198+
199+ user.unarchive()
200+
201+ Returns:
202+ True on success.
203+
204+ Raises:
205+ RPCError: In case of a Telegram RPC error.
206+ """
207+
208+ return self ._client .unarchive_chats (self .id )
You can’t perform that action at this time.
0 commit comments