teleproto - v1.229.0
    Preparing search index...

    Class SessionAbstract

    Hierarchy (View Summary)

    Index
    • get authKey(): AuthKey | undefined

      Returns an AuthKey instance associated with the saved data center, or undefined if a new one should be generated.

      Returns AuthKey | undefined

    • set authKey(value: AuthKey | undefined): void

      Sets the AuthKey to be used for the saved data center.

      Parameters

      • value: AuthKey | undefined

      Returns void

    • Called on client disconnection. Should be used to free any used resources. Can be left empty if none.

      Returns void

    • Called upon client.logOut(). Should delete the stored information from disk since it's not valid anymore.

      Returns void | Promise<void>

    • gets auth key for a dc

      Parameters

      • OptionaldcId: number

      Returns AuthKey | undefined

    • Turns the given key into an InputPeer (e.g. InputPeerUser). The library uses this method whenever an InputPeer is needed to suit several purposes (e.g. user only provided its ID or wishes to use a cached username to avoid extra RPC).

      Parameters

      • key: EntityLike

      Returns TypeInputPeer | Promise<TypeInputPeer>

    • Processes the input TLObject or list and saves whatever information is relevant (e.g., ID or access hash). May be asynchronous; the library awaits the result where possible, and a storage failure never fails the request that produced it.

      Parameters

      • tlo: any

      Returns void | Promise<void>

    • called whenever important properties change. It should make persist the relevant session information to disk.

      Returns string | void

    • sets auth key for a dc

      Parameters

      • OptionalauthKey: AuthKey
      • OptionaldcId: number

      Returns void

    • Sets the information of the data center address and port that the library should connect to, as well as the data center ID, which is currently unused.

      Parameters

      • dcId: number

        {number}

      • serverAddress: string

        {string}

      • port: number

        {number}

      Returns void