OptionalappApp version to be sent when creating the initial connection. Defaults to 1.0.
OptionalautoWhether 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.
OptionalchannelOptionalconnectionThe connection instance to be used when creating a new connection to the servers. It must be a type.
Defaults to ConnectionTCPFull.
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.
OptionalfloodThe threshold below which the library should automatically sleep on flood wait and slow mode wait errors (inclusive).
For instance, if a FloodWaitError for 17s occurs and floodSleepThreshold is 20s, the library will sleep automatically.
If the error was for 21s, it would raise FloodWaitError instead. defaults to 60 sec.
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'.
OptionalmaxLimits how many downloads happen at the same time.
OptionalnetworkWhat type of network connection to use.
OptionalproxyProxy configuration for routing all connections through a proxy server.
Supports two proxy types:
{ MTProxy: true, ip, port, secret }) — Telegram's own obfuscated proxy.
Automatically switches the connection to ConnectionTCPMTProxyAbridged.{ socksType: 4 | 5, ip, port }) — general-purpose SOCKS proxy.
SOCKS5 supports optional username/password authentication.OptionalreCallback 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.
Optionalsequentialdoes nothing for now
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.
OptionaluseWhether to connect to the servers through IPv6 or not. By default this is false.
Interface for creating a new client. All of these have a default value and you should only change those if you know what you are doing.