one more try to fix nosuchelement exception

This commit is contained in:
2022-05-18 15:33:26 +06:00
parent 6c094f3ad9
commit dd369177c1
11 changed files with 27 additions and 74 deletions

View File

@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.types.ChatId
import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl
import kotlinx.serialization.Serializable
import kotlinx.serialization.Transient
@Serializable
data class SubConfig(
@@ -12,9 +13,11 @@ data class SubConfig(
val targetChatId: ChatId,
private val hostUrl: String = telegramBotAPIDefaultUrl
) {
@Transient
val telegramInfo by lazy {
TelegramAPIUrlsKeeper(botToken, hostUrl)
}
@Transient
val bot by lazy {
telegramBot(telegramInfo)
}