Kotlin Telegram Bot 0.10.3 Help

Message chains (FSM)

The most valuable thing in the library is the convenient construction of a dialog with the user (let name it the "chain").

Most dialogs with bot begin with the command. You can also start a chain with a callback, etc.

com/example/myproject/handler/StartHandler.kt

@HandlerComponent class StartHandler : BotHandler({ command("/start") { // here are the actions when the user enters the /start command } })

com/example/myproject/handler/StartHandler.kt

@Factory class StartHandler : BotHandler({ command("/start") { // here are the actions when the user enters the /start command } })

com/example/myproject/handler/StartHandler.kt

fun BotHandling.startHandler() { command("/start") { // here are the actions when the user enters the /start command } }
Last modified: 07 September 2024