DiscardEncryptionRequest

Only users can use this request. See code examples.

---functions---
messages.discardEncryption#f393aea0 flags:# delete_history:flags.0?true chat_id:int = Bool

Returns

Bool

This type has no instances available.

Parameters

chat_idint
delete_historyflagThis argument defaults to None and can be omitted.

Known RPC errors

This request can cause 3 known errors:

ChatIdEmptyErrorThe provided chat ID is empty.
EncryptionAlreadyDeclinedErrorThe secret chat was already declined.
EncryptionIdInvalidErrorThe provided secret chat ID is invalid.

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.messages.DiscardEncryptionRequest(
        chat_id=478614198,
        delete_history=True
    ))
    print(result)