messages.SendEncryptedFile

class pyrogram.raw.functions.messages.SendEncryptedFile

Sends a message with a file attachment to a secret chat

Details:
  • Layer: 227

  • 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
├── silent → true (optional)
├── peer → InputEncryptedChat
│ └── InputEncryptedChat
│ ├── chat_id → int
│ └── access_hash → long
├── random_id → long
├── data → bytes
└── file → InputEncryptedFile
│ ├── id → long
│ ├── parts → int
│ ├── md5_checksum → string
│ └── key_fingerprint → int
│ ├── id → long
│ └── access_hash → long
├── id → long
├── parts → int
└── key_fingerprint → int

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(),
    )
)