Skip to content

Commit

Permalink
Fix bug with /msgall command; bump to 0.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ClockVapor committed Mar 22, 2019
1 parent 4a628be commit b003445
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>clockvapor.telegram.markov-telegram-bot</groupId>
<artifactId>markov-telegram-bot</artifactId>
<version>0.1.0</version>
<version>0.1.1</version>

<properties>
<kotlin.version>1.3.21</kotlin.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit b003445

Please sign in to comment.