teleproto - v1.234.0
    Preparing search index...

    Interface TelegramClientParams

    interface TelegramClientParams {
        appVersion?: string;
        autoReconnect?: boolean;
        baseLogger?: Logger;
        catchUp?: boolean;
        channelPollConcurrency?: number;
        channelPollInterval?: number;
        channelPollRequestInterval?: number;
        connection?: typeof Connection;
        connectionRetries?: number;
        deviceModel?: string;
        downloadPool?: DownloadPoolOptions;
        downloadRetries?: number;
        entityCache?: EntityCacheOptions;
        floodSleepThreshold?: number;
        keepAliveInterval?: number;
        langCode?: string;
        langPack?: string;
        maxConcurrentDownloads?: number;
        networkSocket?: SocketFactory;
        pfs?: boolean;
        proxy?: ProxyInterface;
        reCaptchaCallback?: (siteKey: string) => Promise<string>;
        reconnectRetries?: number;
        requestRetries?: number;
        retryDelay?: number;
        securityChecks?: boolean;
        sequentialUpdates?: boolean;
        systemLangCode?: string;
        systemVersion?: string;
        testServers?: boolean;
        timeout?: number;
        transport?: Transport;
        useIPV6?: boolean;
    }
    Index
    appVersion?: string

    App version to be sent when creating the initial connection. Defaults to 1.0.

    autoReconnect?: boolean

    Whether reconnection should be retried connection_retries times automatically if Telegram disconnects us or not. defaults to true

    baseLogger?: Logger

    Instance of Logger to use.
    If a Logger is given, it'll be used directly. If nothing is given, the default logger will be used.
    To create your own Logger make sure you extends teleproto logger Logger and override log method.

    catchUp?: boolean

    Fetch the updates missed while offline when the session has a saved update state. false starts from the current state instead, like the Bot API's drop_pending_updates. Defaults to true.

    channelPollConcurrency?: number

    Maximum concurrent scheduled channel RPCs. Defaults to 2. More watched channels increase polling latency.

    channelPollInterval?: number

    Channel polling fallback in milliseconds when Telegram omits timeout. Defaults to 1000.

    channelPollRequestInterval?: number

    Minimum spacing in milliseconds between scheduled channel RPCs. Defaults to 250; not a Telegram rate guarantee.

    connection?: typeof Connection

    MTProto packet framing. Defaults to ConnectionTCPObfuscated from teleproto/network/connection.

    connectionRetries?: number

    How many times the connection should retry, either on the initial connection or when Telegram disconnects us.
    May be set to a negative or undefined value for infinite retries, but this is not recommended, since the program can get stuck in an infinite loop.
    defaults to 5

    deviceModel?: string

    Device model to be sent when creating the initial connection. Defaults to os.type().toString().

    downloadPool?: DownloadPoolOptions
    downloadRetries?: number

    How many times we should retry borrowing a sender from another DC when it fails. defaults to 5

    entityCache?: EntityCacheOptions

    Bounds the in-memory entity cache (the hot working set of resolved peers; the session remains the storage tier).

    omitted / true - default limit (4096 peers per user/chat segment); false - disabled, peers are resolved straight from the session store; { max?, ttl? } - explicit policy, ttl in milliseconds, { max: 0 } for an unbounded cache.

    floodSleepThreshold?: number

    Flood waits up to this many seconds (inclusive) are slept through and retried; longer ones throw FloodWaitError. Defaults to 60.

    keepAliveInterval?: number

    TCP keep-alive probe interval in milliseconds. Defaults to 30000. Set to 0 to disable keep-alive probes.

    langCode?: string

    Language code to be sent when creating the initial connection. Defaults to 'en'.

    langPack?: string

    Language pack of the app. langCode is sent only together with it. Defaults to empty.

    maxConcurrentDownloads?: number

    Limits how many downloads happen at the same time.

    networkSocket?: SocketFactory

    Use transport: TcpTransport, WebSocketTransport, SocksTransport, or your own Transport.

    pfs?: boolean

    Use temporary auth keys (perfect forward secrecy) for file transfers. Defaults to false; also turned on when Telegram asks for it with tmp_sessions in the config.

    Use transport: MTProxyTransport, SocksTransport or WebProxyTransport.

    reCaptchaCallback?: (siteKey: string) => Promise<string>

    Callback for handling reCAPTCHA verification. It should return the token obtained after solving the CAPTCHA.

    reconnectRetries?: number

    How many times to reconnect before giving up. This happens after the initial connection is finished
    defaults to infinity

    requestRetries?: number

    How many times a request should be retried.
    Request are retried when Telegram is having internal issues (due to INTERNAL error or RPC_CALL_FAIL error),
    when there is a errors.FloodWaitError less than floodSleepThreshold, or when there's a migrate error.
    defaults to 5.

    retryDelay?: number

    The delay in milliseconds to sleep between automatic reconnections. defaults to 1000

    securityChecks?: boolean

    Whether to check for tampering in messages or not.

    sequentialUpdates?: boolean

    Deliver updates one at a time, awaiting all handlers. Defaults to false. Slow handlers accumulate queued updates; destroy clears pending work.

    systemLangCode?: string

    System lang code to be sent when creating the initial connection. Defaults to 'en'.

    systemVersion?: string

    System version to be sent when creating the initial connection. defaults to os.release().toString() -.

    testServers?: boolean

    Whether to connect to Telegram's test environment instead of production.

    When true:

    • The client starts from test DC2 (149.154.167.40). DC routing follows the same path as production: help.GetConfig is the runtime source of truth, with the built-in test seed table (DC1/DC2/DC3) used as a fallback.
    • You must use a test phone number of the form 99966<dc><4 digits>; the login code is the DC digit repeated 5 times (e.g. 22222 for DC2).
    • Test sessions are not interchangeable with production sessions.

    Defaults to false.

    timeout?: number

    The timeout in seconds for establishing a TCP connection to a DC. An address that exceeds it is closed, the attempt fails fast and the next attempt rotates to an alternative address of that DC.

    transport?: Transport

    How the client reaches Telegram: TcpTransport (default; WebSocketTransport where TCP is unavailable), SocksTransport, HttpProxyTransport, MTProxyTransport, WebSocketTransport or WebProxyTransport.

    useIPV6?: boolean

    Whether to connect to the servers through IPv6 or not. By default this is false.