Layer 220
MessagesSendEncryptedService
Sends a service message to a secret chat.
method
Users
messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
Parameters
| Name | Type | Description |
|---|---|---|
| Peer | InputEncryptedChat | Secret chat ID |
| RandomId | long | Unique client message ID required to prevent message resending |
| Data | bytes | TL-serialization of Decrypted Message type, encrypted with a key generated during chat initialization |
Returns
messages.SentEncryptedMessagePossible Errors
| Code | Type | Description |
|---|---|---|
| 400 | CHAT_ID_INVALID | The provided chat id is invalid. |
| 400 | DATA_INVALID | Encrypted data invalid. |
| 400 | ENCRYPTION_DECLINED | The secret chat was declined. |
| 400 | ENCRYPTION_ID_INVALID | The provided secret chat ID is invalid. |
| 500 | MSG_WAIT_FAILED | A waiting call returned an error. |
| 403 | USER_DELETED | You can't send this secret message because the other participant deleted their account. |
| 403 | USER_IS_BLOCKED | You were blocked by this user. |
Gogram Example
// MessagesSendEncryptedService - positional arguments result, err := client.MessagesSendEncryptedService(&tg.InputEncryptedChat{}, int64(0), []byte{}) if err != nil { // handle error } // result is *tg.MessagesSentEncryptedMessage