DeleteContactsRequest

Only users can use this request. See code examples.

---functions---
contacts.deleteContacts#096a0e00 id:Vector<InputUser> = Updates

Returns

Updates

This type can be an instance of either:

UpdateShortUpdateShortChatMessage
UpdateShortMessageUpdateShortSentMessage
UpdatesUpdatesCombined
UpdatesTooLong

Parameters

idInputUserAnything entity-like will work if the library can find its Input version (e.g., usernames, Peer, User or Channel objects, etc.). A list must be supplied.

Known RPC errors

This request can cause 2 known errors:

NeedMemberInvalidErrorThe provided member is invalid or does not exist (for example a thumb size).
TimeoutErrorA timeout occurred while fetching data from the worker.

You can import these from telethon.errors.

Example

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.contacts.DeleteContactsRequest(
        id=['username']
    ))
    print(result.stringify())