messages.sendEncryptedFile #

Sends a message with a file attachment to a secret chat

Layer 223

messages.sentEncryptedMessage#560f8935 date:int = messages.SentEncryptedMessage;
messages.sentEncryptedFile#9493ff32 date:int file:EncryptedFile = messages.SentEncryptedMessage;
---functions---
messages.sendEncryptedFile#5559481d flags:# silent:flags.0?true peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage;

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
silentflags.0?trueWhether to send the file without triggering a notification
peerInputEncryptedChatSecret chat ID
random_idlongUnique client message ID necessary to prevent message resending. See here » for more info on random ID deduplication and updateMessageID mapping.
databytesTL-serialization of DecryptedMessage type, encrypted with a key generated during chat initialization
fileInputEncryptedFileFile attachment for the secret chat

Result #

messages.SentEncryptedMessage

Only users can use this method #

Possible errors #

CodeTypeDescription
400CHAT_ID_INVALIDThe provided chat id is invalid.
400DATA_TOO_LONGData too long.
400ENCRYPTION_DECLINEDThe secret chat was declined.
400FILE_EMTPYAn empty file was provided.
400MD5_CHECKSUM_INVALIDThe MD5 checksums do not match.
400MSG_WAIT_FAILEDA waiting call returned an error.

Working with Updates #

How to subscribe to updates and handle them properly.

DecryptedMessage #

Object describes the contents of an encrypted message.