Options
All
  • Public
  • Public/Protected
  • All
Menu

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.

Hierarchy

  • TelegramClientParams

Index

Properties

connection?: typeof Connection

The connection instance to be used when creating a new connection to the servers. It must be a type.
Defaults to {@link ConnectionTCPFull} on Node and {@link ConnectionTCPObfuscated} on browsers.

useIPV6?: boolean

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

timeout?: number

The timeout in seconds to be used when connecting. This does nothing for now.

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.

connectionRetries?: number

How many times the reconnection 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

Experimental proxy to be used for the connection. (only supports MTProxies)

downloadRetries?: number

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

retryDelay?: number

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

autoReconnect?: boolean

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

sequentialUpdates?: boolean

does nothing for now

floodSleepThreshold?: number

The 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.

deviceModel?: string

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

systemVersion?: string

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

appVersion?: string

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

langCode?: string

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

systemLangCode?: string

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

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 GramJS logger Logger and override log method.

useWSS?: boolean

Whether to try to connect over Wss (or 443 port) or not.

maxConcurrentDownloads?: number

Limits how many downloads happen at the same time.

securityChecks?: boolean

Whether to check for tampering in messages or not.

testServers?: boolean

Only for web DCs. Whether to use test servers or not.

networkSocket?: typeof PromisedNetSockets | typeof PromisedWebSockets

What type of network connection to use (Normal Socket (for node) or Websockets (for browsers usually) )

Generated using TypeDoc