setup

fun setup(apiId: Int, apiHash: String, phoneNumber: String, databaseDirectory: String = "database", filesDirectory: String = "files")

Initializes the Telegram client with the provided credentials and configuration. This method must be called before using any other functionality of the SDK. It handles loading the appropriate native library based on the operating system and architecture.

Parameters

apiId

The API ID obtained from Telegram's developer portal

apiHash

The API hash obtained from Telegram's developer portal

phoneNumber

The phone number associated with the Telegram account

databaseDirectory

The directory where TDLib will store its database files

filesDirectory

The directory where TDLib will store downloaded files

Throws

if the current OS or architecture is not supported

if the native library fails to load