pub async fn set_tdlib_parameters(
use_test_dc: bool,
database_directory: String,
files_directory: String,
database_encryption_key: String,
use_file_database: bool,
use_chat_info_database: bool,
use_message_database: bool,
use_secret_chats: bool,
api_id: i32,
api_hash: String,
system_language_code: String,
device_model: String,
system_version: String,
application_version: String,
client_id: i32,
) -> Result<(), Error>
Expand description
Sets the parameters for TDLib initialization. Works only when the current authorization state is authorizationStateWaitTdlibParameters
§Arguments
use_test_dc
- Pass true to use Telegram test environment instead of the production environmentdatabase_directory
- The path to the directory for the persistent database; if empty, the current working directory will be usedfiles_directory
- The path to the directory for storing files; if empty, database_directory will be useddatabase_encryption_key
- Encryption key for the database. If the encryption key is invalid, then an error with code 401 will be returneduse_file_database
- Pass true to keep information about downloaded and uploaded files between application restartsuse_chat_info_database
- Pass true to keep cache of users, basic groups, supergroups, channels and secret chats between restarts. Implies use_file_databaseuse_message_database
- Pass true to keep cache of chats and messages between restarts. Implies use_chat_info_databaseuse_secret_chats
- Pass true to enable support for secret chatsapi_id
- Application identifier for Telegram API access, which can be obtained at https:my.telegram.orgapi_hash
- Application identifier hash for Telegram API access, which can be obtained at https:my.telegram.orgsystem_language_code
- IETF language tag of the user’s operating system language; must be non-emptydevice_model
- Model of the device the application is being run on; must be non-emptysystem_version
- Version of the operating system the application is being run on. If empty, the version is automatically detected by TDLibapplication_version
- Application version; must be non-emptyclient_id
- The client id to send the request to