@tgsnake/skema
    Preparing search index...

    Class UpdateSecretChatMessage

    Represents a decrypted secret chat message update wrapper.

    This modified update structure wraps raw incoming Telegram encrypted updates (UpdateNewEncryptedMessage) and replaces the encrypted message payload with its fully-decrypted message or service structure. This simplifies message handling by eliminating manual decrypt stages.

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    The original raw Telegram encrypted update instance.

    _slots: string[]

    The internal slot list storing serialization field property names.

    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.

    The decrypted message or service message payload.

    qts: number

    The queue timestamp (QTS) parameter indicating the sequence order of the update.

    subclassOfId: number

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

    Accessors

    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 current class instance into a raw binary buffer.

      Parameters

      • ...args: any[]

        Arguments passed down to the writer.

      Returns Buffer

      A Buffer containing the serialized representation of this object.

    • Decrypts a raw encrypted update and generates a fully decrypted UpdateSecretChatMessage wrapper.

      Type Parameters

      Parameters

      • update: UpdateNewEncryptedMessage

        The raw UpdateNewEncryptedMessage containing the encrypted payload.

      • secretChat: T

        The secret chat session manager used to decrypt the message bytes.

      Returns Promise<UpdateSecretChatMessage>

      A promise resolving to the decrypted UpdateSecretChatMessage instance.

      This static factory determines whether the encrypted message is a standard user message or a service message (e.g. key exchange requests), calls secretChat.decrypt() to decrypt the body, constructs the appropriate wrapper class (SecretChatMessage or SecretChatMessageService), and returns the finalized update object.

    • Reads and deserializes a generic TLObject from a binary stream.

      Parameters

      • data: BytesIO

        The BytesIO buffer stream containing the serialized TLObject.

      • ...args: any[]

        Additional arguments passed down to the resolved subclass's static read implementation.

      Returns Promise<any>

      A promise resolving to the parsed class instance.

      This method first reads the leading 32-bit little-endian integer from the stream, which is treated as the unique constructorId (or Class ID). It resolves the constructor class dynamically from the global TL object map (AllTLObject) and delegates parsing to the subclass's static read method.

    • 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.