BotConfiguration

abstract class BotConfiguration(source)

Base configuration for a Telegram bot.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open val allowedUpdates: List<UpdateType>? = null

The types of updates to be received and processed.

Link copied to clipboard
open val autostartLongPolling: Boolean = true

Start long polling after the bot is created.

Link copied to clipboard
open val identifier: String

An identifier for this bot, used to match configuration and bot instance, empty list to receive all update types except chat_member, message_reaction, and message_reaction_count (default). If not specified, the previous setting will be used.

Functions

Link copied to clipboard
abstract fun applyCfg(): BotConfigurator

Specify the configuration that will be applied to the bot.

Link copied to clipboard
open suspend fun onHandlerException(exception: Throwable)

Called when an exception is thrown by a handler. Handler is automatically restarts by default after this hook is called. Default behavior is to delay for 3 seconds.

Link copied to clipboard
open suspend fun onInit(bot: TelegramBot)

Called after the bot is created and before it starts.