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
api Id
The API ID obtained from Telegram's developer portal
api Hash
The API hash obtained from Telegram's developer portal
phone Number
The phone number associated with the Telegram account
database Directory
The directory where TDLib will store its database files
files Directory
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