messages.sendEncrypted #

Sends a text message to a secret chat.

Layer 223

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

Parameters #

NameTypeDescription
flags#Flags, see TL conditional fields
silentflags.0?trueSend encrypted message without a notification
peerInputEncryptedChatSecret chat ID
random_idlongUnique client message ID, necessary to avoid message resending. See here » for more info on random ID deduplication and updateMessageID mapping.
databytesTL-serialization of DecryptedMessage type, encrypted with a key that was created during chat initialization

Result #

messages.SentEncryptedMessage

Only users can use this method #

Possible errors #

CodeTypeDescription
400CHAT_ID_INVALIDThe provided chat id is invalid.
400DATA_INVALIDEncrypted data invalid.
400DATA_TOO_LONGData too long.
400ENCRYPTION_DECLINEDThe secret chat was declined.
500MSG_WAIT_FAILEDA waiting call returned an error.
403USER_IS_BLOCKEDYou were blocked by this user.

Working with Updates #

How to subscribe to updates and handle them properly.

DecryptedMessage #

Object describes the contents of an encrypted message.