@tgsnake/skema
    Preparing search index...

    Class UpdateSecretChatMessage

    Represents an update for a secret chat message, wrapping the decrypted message and related metadata.

    This class is used to handle updates for new encrypted messages in secret chats, providing access to the decrypted message, the QTS (queue timestamp), and the original raw update object. Modified class of UpdateNewEncryptedMessage. The update object should be left as received but should be decrypted already. Therefore this modification was made to facilitate management so there is no need to manually decrypt.

    • The message property can be either a SecretChatMessage or a SecretChatMessageService.
    • The static generate method handles decryption and instantiation based on the type of the raw message.
    const update = await UpdateSecretChatMessage.generate(rawUpdate, secretChatInstance);
    console.log(update.message);

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    _slots: string[]

    Internal array of slot names for the object.

    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.

    The decrypted secret chat message or service message.

    qts: number

    The queue timestamp associated with the update.

    subclassOfId: number

    Identifier for the parent class (if any).

    Accessors

    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 provided arguments using the associated class's write method.

      Parameters

      • ...args: any[]

        The arguments to be serialized.

      Returns Buffer

      The resulting Buffer after serialization.

    • Generates an UpdateSecretChatMessage instance by decrypting the provided encrypted message using the given secret chat context.

      Depending on the type of the encrypted message (EncryptedMessageService or not), this method constructs the appropriate secret chat message object.

      Type Parameters

      • T

        The type of the secret chat context, which must implement a decrypt method.

      Parameters

      • update: UpdateNewEncryptedMessage

        The raw update containing the new encrypted message.

      • secretChat: T

        The secret chat context used to decrypt the message.

      Returns Promise<UpdateSecretChatMessage>

      A promise that resolves to an UpdateSecretChatMessage containing the decrypted message.

    • Reads a TLObject from the provided BytesIO stream.

      This static method reads a 32-bit unsigned integer (interpreted as the object ID) from the stream, logs the reading operation, dynamically resolves the corresponding TLObject class, and delegates the reading process to that class's read method.

      Parameters

      • data: BytesIO

        The BytesIO stream to read the TLObject from.

      • ...args: any[]

        Additional arguments to pass to the resolved TLObject's read method.

      Returns Promise<any>

      A Promise that resolves to the deserialized TLObject instance.

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