SendEncryptedFileRequest
Only users can use this request. See code examples.
---functions--- messages.sendEncryptedFile#5559481d flags:# silent:flags.0?true peer:InputEncryptedChat random_id:long data:bytes file:InputEncryptedFile = messages.SentEncryptedMessage
Returns
| messages.SentEncryptedMessage | 
This type can be an instance of either:
| SentEncryptedFile | SentEncryptedMessage | 
Parameters
| peer | InputEncryptedChat | |
| data | bytes | |
| file | InputEncryptedFile | |
| silent | flag | This argument defaults to Noneand can be omitted. | 
| random_id | long | If left unspecified, it will be inferred automatically. | 
Known RPC errors
This request can cause 1 known error:
| MsgWaitFailedError | A waiting call returned an error. | 
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.SendEncryptedFileRequest(
        peer=types.InputEncryptedChat(
            chat_id=478614198,
            access_hash=-12398745604826
        ),
        data=b'arbitrary\x7f data \xfa here',
        file=types.InputEncryptedFileUploaded(
            id=-12398745604826,
            parts=42,
            md5_checksum='some string here',
            key_fingerprint=42
        )
    ))
    print(result.stringify())