OptionalappOptionalautoWhether reconnection should be retried connection_retries times automatically if Telegram disconnects us or not. defaults to true
OptionalbaseInstance 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.
OptionalcatchFetch 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.
OptionalchannelMaximum concurrent scheduled channel RPCs. Defaults to 2. More watched channels increase polling latency.
OptionalchannelChannel polling fallback in milliseconds when Telegram omits timeout. Defaults to 1000.
OptionalchannelMinimum spacing in milliseconds between scheduled channel RPCs. Defaults to 250; not a Telegram rate guarantee.
OptionalconnectionMTProto packet framing. Defaults to ConnectionTCPObfuscated from teleproto/network/connection.
OptionalconnectionHow 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
OptionaldeviceDevice model to be sent when creating the initial connection. Defaults to os.type().toString().
OptionaldownloadOptionaldownloadHow many times we should retry borrowing a sender from another DC when it fails. defaults to 5
OptionalentityBounds 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.
OptionalfloodFlood waits up to this many seconds (inclusive) are slept through and retried; longer ones throw FloodWaitError. Defaults to 60.
OptionalkeepTCP keep-alive probe interval in milliseconds. Defaults to 30000. Set to 0 to disable keep-alive probes.
OptionallangLanguage code to be sent when creating the initial connection. Defaults to 'en'.
OptionallangLanguage pack of the app. langCode is sent only together with it. Defaults to empty.
OptionalmaxLimits how many downloads happen at the same time.
OptionalnetworkOptionalpfsUse 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.
OptionalproxyOptionalreCallback for handling reCAPTCHA verification. It should return the token obtained after solving the CAPTCHA.
OptionalreconnectHow many times to reconnect before giving up. This happens after the initial connection is finished
defaults to infinity
OptionalrequestHow 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.
OptionalretryThe delay in milliseconds to sleep between automatic reconnections. defaults to 1000
OptionalsecurityWhether to check for tampering in messages or not.
OptionalsequentialDeliver updates one at a time, awaiting all handlers. Defaults to false. Slow handlers accumulate queued updates; destroy clears pending work.
OptionalsystemSystem lang code to be sent when creating the initial connection. Defaults to 'en'.
OptionalsystemSystem version to be sent when creating the initial connection. defaults to os.release().toString() -.
OptionaltestWhether to connect to Telegram's test environment instead of production.
When true:
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.99966<dc><4 digits>; the login
code is the DC digit repeated 5 times (e.g. 22222 for DC2).Defaults to false.
OptionaltimeoutThe 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.
OptionaltransportHow the client reaches Telegram: TcpTransport (default; WebSocketTransport where TCP is unavailable), SocksTransport, HttpProxyTransport,
MTProxyTransport, WebSocketTransport or WebProxyTransport.
OptionaluseWhether to connect to the servers through IPv6 or not. By default this is false.
App version to be sent when creating the initial connection. Defaults to 1.0.