@tgsnake/skema
    Preparing search index...

    Class Message

    Represents a standard MTProto transport container message.

    Every message transmitted or received over the MTProto protocol is wrapped in a Message envelope. The envelope includes metadata crucial for routing and ordering: the message ID (which indicates client/server time synchronization), the message sequence number, the body byte length, and the actual serialized payload/body TLObject.

    Hierarchy (View Summary)

    Index

    Constructors

    • Constructs a new Message envelope.

      Parameters

      • body: TLObject

        The inner body payload of the message.

      • msgId: bigint

        The 64-bit message identifier.

      • seqNo: number

        The session message sequence number.

      • length: number

        The byte length of the body.

      Returns Message

    Properties

    _slots: string[]

    The internal slot list storing serialization field property names.

    body: TLObject

    The inner body deserialized as a TLObject.

    className: string

    The canonical string name of this class representation.

    classType: string

    The underlying classification type (e.g. request, constructor, function).

    cls: any = ...

    A dynamic reference to the current subclass constructor. Enables late static binding for instance methods to access static helper operations.

    constructorId: number

    The unique 32-bit integer identifier (CRC32 checksum) of this TL constructor.

    length: number

    The length of the serialized message body in bytes.

    msgId: bigint

    The unique 64-bit message identifier, representing the creation time of the message in seconds multiplied by 2^32.

    seqNo: number

    The message sequence number, indicating the order of the message in the session.

    subclassOfId: number

    The unique 32-bit integer identifier of the parent/abstract type this TL subclass represents.

    ID: number = 0x5bb8e511

    The unique class ID identifier representing Message (0x5bb8e511).

    Methods

    • Deserializes a binary stream into this specific TLObject instance.

      Parameters

      • data: BytesIO

        The BytesIO buffer stream containing the serialized TLObject.

      • ...args: any[]

        Additional arguments passed down to the read parser.

      Returns Promise<any>

      A promise resolving to the parsed instance.

    • Serializes the TLObject instance to a clean JSON-compatible representation.

      Returns { [key: string]: any }

      A plain object containing class attributes and values.

      Correctly stringifies extremely large fields (e.g. bigints) that are normally not serializable in standard JSON.stringify calls.

    • Formats the TLObject into a structured string.

      Returns string

      A string starting with the constructor name followed by a pretty JSON payload.

    • Serializes the message envelope and its body into a raw binary buffer.

      Returns Buffer

      A Buffer representing the complete message envelope structure.

    • Reads and deserializes a Message envelope from a binary stream.

      Parameters

      • data: BytesIO

        The BytesIO stream containing the serialized message envelope.

      • ..._args: any[]

        Unused additional parameters.

      Returns Promise<Message>

      A promise resolving to the deserialized Message instance.

    • Serializes constructor arguments into a raw binary buffer.

      Parameters

      • ..._args: any[]

        Arguments to be serialized.

      Returns Buffer

      An empty Buffer of size 0.

      This base implementation acts as an abstract stub returning an empty Buffer. Subclasses override this static method to handle specific binary serialization layouts.