block_user()

Client.block_user()

Block a user.

Usable by Users Bots
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

await app.block_user(user_id)