one more try to fix nosuchelement exception
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
Reference in New Issue
Block a user