TelegramBot

class TelegramBot(token: String, commandsPackage: String? = null, botConfiguration: BotConfigurator = {})

Telegram bot main instance

Parameters

commandsPackage

The place where the search for commands and inputs will be done.

botConfiguration

Lambda function to customize the bots instance. See BotConfiguration

Constructors

Link copied to clipboard
constructor(configLoader: ConfigLoader)

Constructor to build through configuration loader.

constructor(token: String, commandsPackage: String? = null, httpClient: HttpClient? = null, botConfiguration: BotConfigurator = {})
constructor(token: String, commandsPackage: String? = null, botConfiguration: BotConfigurator = {})

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard

Bot identifier set through configuration.

Link copied to clipboard

A tool for managing input waiting.

Link copied to clipboard

Current bot UpdateHandler instance

Functions

Link copied to clipboard
defineActivities
Link copied to clipboard
Link copied to clipboard
suspend fun getFileContent(file: File): ByteArray?

Get file from File if File.filePath is present.

Link copied to clipboard

Get direct url from File if File.filePath is present

Link copied to clipboard
fun <T : Any> TelegramBot.getInstance(kClass: KClass<T>, vararg initParams: Any?): T

Method to get given class instance through defined ClassManager.

Link copied to clipboard
suspend fun handleUpdates(allowedUpdates: List<UpdateType>? = null)

Function for processing updates by long-pulling using annotation commands.

suspend fun handleUpdates(allowedUpdates: List<UpdateType>? = null, block: FunctionalHandlingBlock)

Function for processing updates by long-pulling using functional handling.