SendEncryptedServiceRequest
Only users can use this request. See code examples.
---functions--- messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage
Returns
messages.SentEncryptedMessage |
This type can be an instance of either:
SentEncryptedFile | SentEncryptedMessage |
Parameters
peer | InputEncryptedChat | |
data | bytes | |
random_id | long | If left unspecified, it will be inferred automatically. |
Known RPC errors
This request can cause 4 known errors:
DataInvalidError | Encrypted data invalid. |
EncryptionDeclinedError | The secret chat was declined. |
MsgWaitFailedError | A waiting call returned an error. |
UserIsBlockedError | User is blocked. |
You can import these from telethon.errors
.
Example
from telethon.sync import TelegramClient from telethon import functions, types with TelegramClient(name, api_id, api_hash) as client: result = client(functions.messages.SendEncryptedServiceRequest( peer=types.InputEncryptedChat( chat_id=478614198, access_hash=-12398745604826 ), data=b'arbitrary\x7f data \xfa here' )) print(result.stringify())