Documentation - v0.27.0
    Preparing search index...

    Class BaseTelegramClient

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    appConfig: AppConfigManager = ...

    App config manager

    log: Logger

    Logger for the client

    onConnectionState: Emitter<ConnectionState> = ...

    Emitted when the connection state changes

    onError: Emitter<Error> = ...

    Emitted when an error occurs

    onRawUpdate: Emitter<RawUpdateInfo> = ...

    Emitted when an update is received from the server. Requires updates loop to be running

    onServerUpdate: Emitter<TypeUpdates> = ...

    Emitted when a low-level Updates updates is received

    platform: ICorePlatform

    Platform used by the client

    Storage manager

    timers: TimersManager

    Timers manager

    updates?: UpdatesManager

    Accessors

    • get stopSignal(): AbortSignal

      Signal that will be aborted when the client is destroyed

      Returns AbortSignal

    Methods

    • Export current session to a single LONG string, containing all the needed information.

      Warning! Anyone with this string will be able to authorize as you and do anything. Treat this as your password, and never give it away!

      In case you have accidentally leaked this string, make sure to revoke this session in account settings: "Privacy & Security" > "Active sessions" > find the one containing mtcute > Revoke, or, in case this is a bot, revoke bot token with @BotFather

      Returns Promise<string>

    • Import the session from the given session string.

      Note that the session will only be imported in case the storage is missing authorization (i.e. does not contain auth key for the primary DC), otherwise it will be ignored (unless force).

      Parameters

      • session: string | InputStringSessionData

        Session string to import

      • force: boolean = false

        Whether to overwrite existing session

      Returns Promise<void>