forked from AeonOrg/Electrogram
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathunblock_user.py
More file actions
32 lines (24 loc) · 992 Bytes
/
Copy pathunblock_user.py
File metadata and controls
32 lines (24 loc) · 992 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
from __future__ import annotations
import pyrogram
from pyrogram import raw
class UnblockUser:
async def unblock_user(self: pyrogram.Client, user_id: int | str) -> bool:
"""Unblock a user.
.. include:: /_includes/usable-by/users.rst
Parameters:
user_id (``int`` | ``str``):
Unique identifier (int) or username (str) of the target user.
For you yourself you can simply use "me" or "self".
For a contact that exists in your Telegram address book you can use his phone number (str).
You can also use user profile link in form of *t.me/<username>* (str).
Returns:
``bool``: True on success
Example:
.. code-block:: python
await app.unblock_user(user_id)
"""
return bool(
await self.invoke(
raw.functions.contacts.Unblock(id=await self.resolve_peer(user_id)),
),
)