Layer 220
method Users
messages.discardEncryption#f393aea0 flags:# delete_history:flags.0?true chat_id:int = Bool;

Parameters

Name Type Description
Flags # Flags, see TL conditional fields
DeleteHistory flags.0?true Whether to delete the entire chat history for the other user as well
ChatId int Secret chat ID

Returns

Bool

Possible Errors

Code Type Description
400 CHAT_ID_EMPTY The provided chat ID is empty.
400 ENCRYPTION_ALREADY_ACCEPTED Secret chat already accepted.
400 ENCRYPTION_ALREADY_DECLINED The secret chat was already declined.
400 ENCRYPTION_ID_INVALID The provided secret chat ID is invalid.

Gogram Example

// MessagesDiscardEncryption - using Params struct
result, err := client.MessagesDiscardEncryption(&tg.MessagesDiscardEncryptionParams{
    ChatId: 0,

    // Optional fields:
    // DeleteHistory: true,
})
if err != nil {
    // handle error
}
// result is *tg.Bool