Layer 227
method Users
messages.sendEncryptedFile#5559481d flags:# silent:flags.0?true peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;

Parameters

Name Type Description
Silent flags .0? true Whether to send the file without triggering a notification
Peer InputEncryptedChat Secret chat ID
RandomId long Unique client message ID necessary to prevent message resending
Data bytes TL-serialization of Decrypted Message type, encrypted with a key generated during chat initialization
File InputEncryptedFile File attachment for the secret chat

Gogram Example

// MessagesSendEncryptedFile - positional arguments
result, err := client.MessagesSendEncryptedFile(nil, &tg.InputEncryptedChat{}, int64(1234567890), []byte{0x01, 0x02, 0x03}, &tg.InputEncryptedFileUploaded{})
if err != nil {
    // handle error
}
// result is *tg.MessagesSentEncryptedMessage

Possible Errors

Code Type Description
400 CHAT_ID_INVALID The provided chat id is invalid.
400 DATA_TOO_LONG Data too long.
400 ENCRYPTION_DECLINED The secret chat was declined.
400 FILE_EMTPY An empty file was provided.
400 MD5_CHECKSUM_INVALID The MD 5 checksums do not match.
400 MSG_WAIT_FAILED A waiting call returned an error.