TGListener SDK
object TGListenerSDK
Main entry point for the Telegram Listener SDK. This object provides functionality to interact with the Telegram API using TDLib. It handles the initialization of the native library and provides methods to listen to chat messages.
Functions
Link copied to clipboard
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.
Link copied to clipboard
Starts listening to messages from specified chats. Returns a Flow of NewMessage objects that can be collected to receive new messages.