messages.sendEncryptedService #

Sends a service 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.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;

Parameters #

NameTypeDescription
peerInputEncryptedChatSecret chat ID
random_idlongUnique client message ID required 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

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.
400ENCRYPTION_ID_INVALIDThe provided secret chat ID is invalid.
500MSG_WAIT_FAILEDA waiting call returned an error.
403USER_DELETEDYou can't send this secret message because the other participant deleted their account.
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.