diff --git a/pom.xml b/pom.xml index a7f7dc1..a4b4d81 100644 --- a/pom.xml +++ b/pom.xml @@ -7,7 +7,7 @@ clockvapor.telegram.markov-telegram-bot markov-telegram-bot - 0.1.0 + 0.1.1 1.3.21 diff --git a/src/main/kotlin/clockvapor/telegram/markov/MarkovTelegramBot.kt b/src/main/kotlin/clockvapor/telegram/markov/MarkovTelegramBot.kt index 68b02e2..ce47f2f 100644 --- a/src/main/kotlin/clockvapor/telegram/markov/MarkovTelegramBot.kt +++ b/src/main/kotlin/clockvapor/telegram/markov/MarkovTelegramBot.kt @@ -343,11 +343,11 @@ class MarkovTelegramBot(private val token: String, private val dataPath: String) ?.generateWithCaseInsensitiveSeed(seed) private fun generateMessageTotal(chatId: String): String? = - tryOrNull(reportException = false) { MarkovChain.read(getTotalMarkovPath(chatId)) }?.generate() + tryOrNull(reportException = false) { getOrCreateTotalMarkovChain(chatId) }?.generate() ?.takeIf { it.isNotEmpty() }?.joinToString(" ") private fun generateMessageTotal(chatId: String, seed: String): MarkovChain.GenerateWithSeedResult? = - tryOrNull(reportException = false) { MarkovChain.read(getTotalMarkovPath(chatId)) } + tryOrNull(reportException = false) { getOrCreateTotalMarkovChain(chatId) } ?.generateWithCaseInsensitiveSeed(seed) private fun reply(bot: Bot, message: Message, text: String, parseMode: ParseMode? = null) {