messages.SendEncryptedFile

class pyrogram.raw.functions.messages.SendEncryptedFile

Sends a message with a file attachment to a secret chat

Details:
  • Layer: 223

  • ID: 5559481D

Parameters:
  • peer (InputEncryptedChat) – Secret chat ID

  • random_id (int 64-bit) – Unique client message ID necessary to prevent message resending

  • data (bytes) – TL-serialization of DecryptedMessage type, encrypted with a key generated during chat initialization

  • file (InputEncryptedFile) – File attachment for the secret chat

  • silent (bool, optional) – Whether to send the file without triggering a notification

Returns:

messages.SentEncryptedMessage

TL Schema

messages.sendEncryptedFile#5559481d
flags:#
silent:flags.0?true
peer:InputEncryptedChat
random_id:long
data:bytes
file:InputEncryptedFile

= messages.SentEncryptedMessage

Parameter Tree

SendEncryptedFile
├── silenttrue (optional)
├── peerInputEncryptedChat
│ └── InputEncryptedChat
│ ├── chat_idint
│ └── access_hashlong
├── random_idlong
├── databytes
└── fileInputEncryptedFile
│ ├── idlong
│ ├── partsint
│ ├── md5_checksumstring
│ └── key_fingerprintint
│ ├── idlong
│ └── access_hashlong
├── idlong
├── partsint
└── key_fingerprintint

Example

await app.invoke(
    SendEncryptedFile(
        silent=None,
        peer=InputEncryptedChat(
            chat_id=0,
            access_hash=0
        ),
        random_id=app.rnd_id(),
        data=b"data",
        file=InputEncryptedFileEmpty(),
    )
)