Skip to content

miniproto.connection.sender.MTProtoSender.send

miniproto.connection.sender.MTProtoSender.send

Section titled “miniproto.connection.sender.MTProtoSender.send”
send(body: bytes | object, *, content_related: bool = True) -> int

Send a one-way encrypted message and return its MTProto message ID.

Parameters:

  • body (bytes | object) – Encoded bytes or serializable TL body to encrypt and send.
  • content_related (bool) – Whether sequence allocation marks the message as content-related; defaults to True.

Returns:

  • int – The allocated message ID after the packet is accepted by the local
  • int – transport write path.

Raises:

Notes

This does not create a result future and may retry a raw transport write once during recovery. It serializes with all requests.