Exposed
To save the state in the database, it is necessary to connect to it using Exposed (example). Then add the dependency and specify the sources:
dependencies {
implementation("io.github.dehuckakpyt.telegrambot:telegram-bot-core:0.11.2")
implementation("io.github.dehuckakpyt.telegrambot:telegram-bot-source-exposed:0.11.2")
}
val config = TelegramBotConfig().apply {
messageSource = { MessageSource.inDatabase }
receiving {
callbackContentSource = {
CallbackContentSource.inDatabase(
maxCallbackContentsPerUser = 20
)
}
chainSource = { ChainSource.inDatabase }
}
}
Last modified: 27 July 2024