Documentation - v0.29.0
    Preparing search index...

    Interface TelegramWorkerOptions<T>

    interface TelegramWorkerOptions<T extends WorkerCustomMethods> {
        client: BaseTelegramClient;
        customMethods?: T;
        onLastDisconnected?: "disconnect" | "destroy" | "nothing";
        workerId?: string;
    }

    Type Parameters

    Index

    Properties

    customMethods?: T

    additional custom methods to expose

    onLastDisconnected?: "disconnect" | "destroy" | "nothing"

    What to do when the last connection to the worker is closed?

    • destroy: destroy the client, terminating the worker
    • disconnect: disconnect the client, but keep the worker running until forceDestroy is called
    • nothing: do nothing, lifecycle is managed manually
    'nothing'
    
    workerId?: string

    mtcute worker ID to disambiguate multiple clients within the same underlying worker