messages.SendEncrypted

class pyrogram.raw.functions.messages.SendEncrypted

Sends a text message to a secret chat.

Details:
  • Layer: 223

  • ID: 44FA7A15

Parameters:
  • peer (InputEncryptedChat) – Secret chat ID

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

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

  • silent (bool, optional) – Send encrypted message without a notification

Returns:

messages.SentEncryptedMessage

TL Schema

messages.sendEncrypted#44fa7a15
flags:#
silent:flags.0?true
peer:InputEncryptedChat
random_id:long
data:bytes

= messages.SentEncryptedMessage

Parameter Tree

SendEncrypted
├── silenttrue (optional)
├── peerInputEncryptedChat
│ └── InputEncryptedChat
│ ├── chat_idint
│ └── access_hashlong
├── random_idlong
└── databytes

Example

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