send_encrypted_file()

async Client.send_encrypted_file()

Send an encrypted file to a secret chat.

Usable by Users Bots
Parameters:
  • peer (InputEncryptedChat) – The secret chat to send to.

  • random_id (int) – Random ID for deduplication.

  • data (bytes) – The encrypted message bytes.

  • file (InputEncryptedFile) – The encrypted file to attach.

  • silent (bool, optional) – If True, send without notification.

Returns:

SentEncryptedMessage – The sent message info.

Example

await app.send_encrypted_file(peer, random_id=123, data=b"...", file=enc_file)