@tgsnake/skema
    Preparing search index...

    Class Message

    tgsnake - Telegram MTProto library for javascript or typescript. Copyright (C) 2025 tgsnake https://github.com/tgsnake

    THIS FILE IS PART OF TGSNAKE

    tgsnake is a free software: you can redistribute it and/or modify it under the terms of the MIT License as published.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _slots: string[]

    Internal array of slot names for the object.

    body: TLObject
    className: string

    Name of the class.

    classType: string

    Type of the class.

    cls: any = ...

    Reference to the constructor of the current class (late static binding).

    constructorId: number

    Unique identifier for the constructor.

    length: number
    msgId: bigint
    seqNo: number
    subclassOfId: number

    Identifier for the parent class (if any).

    ID: number = 0x5bb8e511

    Methods

    • Reads data from the provided BytesIO instance and processes it using the associated class's read method.

      Parameters

      • data: BytesIO

        The BytesIO instance containing the data to be read.

      • ...args: any[]

        Additional arguments to be passed to the class's read method.

      Returns Promise<any>

      A promise that resolves with the result of the read operation.

    • Serializes the message into a Buffer.

      This method writes the message ID, sequence number, length, and body into a BytesIO stream in a specific binary format, then returns the resulting data as a Node.js Buffer.

      Returns Buffer

      The serialized message as a Buffer.

    • Reads a Message object from the provided BytesIO stream.

      This method sequentially reads the message ID, sequence number, and body length from the stream, then reads the message body of the specified length. It constructs a new Message instance using the deserialized body and the extracted metadata.

      Parameters

      • data: BytesIO

        The BytesIO stream to read the message from.

      • ..._args: any[]

        Additional arguments (unused).

      Returns Promise<Message>

      A promise that resolves to the deserialized Message object.

    • Serializes the provided arguments into a Buffer.

      Parameters

      • ..._args: any[]

        The arguments to be serialized.

      Returns Buffer

      A Buffer containing the serialized data.

      This is a static method. The current implementation returns an empty Buffer.