link
Airgram configuration
This page describes the options you can pass to Airgram
constructor:
import { Airgram, } from 'airgram'
const airgram = new Airgram({
// options
})
link
Common options
Key | Type | Note |
---|---|---|
logVerbosityLevel | number | The verbosity level for logging. Value 0 corresponds to fatal errors, value 1 corresponds to errors, value 2 corresponds to warnings and debug warnings, value 3 corresponds to informational, value 4 corresponds to debug, value 5 corresponds to verbose debug, value greater than 5 and up to 1024 can be used to enable even more logging. |
context | Function |Object | Object or function that returns an object with custom context. Details. |
link
TDLib
options
Key | Type | Note |
---|---|---|
useTestDc | boolean | If set to true, the Telegram test environment will be used instead of the production environment |
databaseDirectory | string | The path to the directory for the persistent database |
filesDirectory | string | The path to the directory for storing files |
useFileDatabase | boolean | If set to true, information about downloaded and uploaded files will be saved between application restarts |
useChatInfoDatabase | boolean | If set to true, the library will maintain a cache of users, basic groups, supergroups, channels and secret chats. Implies useFileDatabase |
useMessageDatabase | boolean | If set to true, the library will maintain a cache of chats and messages. Implies useChatInfoDatabase |
useSecretChats | boolean | If set to true, support for secret chats will be enabled |
apiId | number | Application identifier for Telegram API access, which can be obtained at https://my.telegram.org |
apiHash | string | Application identifier hash for Telegram API access, which can be obtained at https://my.telegram.org |
systemLanguageCode | string | IETF language tag of the user's operating system language |
deviceModel | string | Model of the device the application is being run on |
systemVersion | string | Version of the operating system the application is being run on |
applicationVersion | string | Application version |
enableStorageOptimizer | boolean | If set to true, old files will automatically be deleted |
ignoreFileNames | boolean | If set to true, original file names will be ignored. Otherwise, downloaded files will be saved under names as close as possible to the original name |
databaseEncryptionKey | string | Encryption key |
link
Node.js version
Key | Type | Note |
---|---|---|
command | string | Path to the tdjson (windows) / libtdjson (unix) command. |
link
Web version
Key | Type | Note |
---|---|---|
instanceName | string | Name of the TDLib instance. Currently only one instance of TdClient with a given name is allowed. All but one instances with the same name will be automatically closed. Usually, the newest non-background instance is kept alive. Files will be stored in an IndexedDb table with the same name. |
isBackground | boolean | Pass true, if the instance is opened from the background. Default: false |
jsLogVerbosityLevel | string | The initial verbosity level of the JavaScript part of the code (one of 'error', 'warning', 'info', 'log', 'debug'). Default: info |
useDatabase | boolean | Pass false to use TDLib without database and secret chats. It will significantly improve loading time, but some functionality will be unavailable. Default: true |
readOnly | boolean | For debug only. Pass true to open TDLib database in read-only mode. Default: false |
mode | string | For debug only. The type of the TDLib build to use. 'asmjs' for asm.js and 'wasm' for WebAssembly. If mode == 'auto' WebAbassembly will be used if supported by browser, asm.js otherwise. Default: auto |