diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 32f5ed9..9d7c978 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,12 +1,12 @@ [versions] -kotlin = "1.7.10" -tgbotapi = "3.2.1" -microutils = "0.12.11" +kotlin = "1.7.22" +tgbotapi = "4.2.1" +microutils = "0.16.1" imageboard = "2.5.2" -krontab = "0.8.0" -kslog = "0.5.1" -exposed = "0.39.2" +krontab = "0.8.4" +kslog = "0.5.4" +exposed = "0.41.1" psql = "42.5.0" clikt = "3.5.0" diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index ae04661..070cb70 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/src/main/kotlin/App.kt b/src/main/kotlin/App.kt index cdbe72a..9d80184 100644 --- a/src/main/kotlin/App.kt +++ b/src/main/kotlin/App.kt @@ -162,7 +162,7 @@ suspend fun main(args: Array) { val parser = EnableArgsParser(onlyQueryIsRequired = false) runCatchingSafely { parser.parse(args) - repo.set(it.chat.id, parser.resultSettings ?: return@runCatchingSafely) + repo.set(ChatId(it.chat.id.chatId), parser.resultSettings ?: return@runCatchingSafely) }.onFailure { e -> e.printStackTrace() if (it.chat is PrivateChat) { @@ -179,14 +179,14 @@ suspend fun main(args: Array) { val args = it.content.textSources.drop(1).joinToString("") { it.source }.trim().takeIf { it.isNotBlank() } ?.split(" ") val chatSettings = if (args.isNullOrEmpty()) { - repo.get(it.chat.id) ?: run { + repo.get(ChatId(it.chat.id.chatId)) ?: run { if (it.chat is PrivateChat) { reply(it, "Unable to find default config") } return@onCommand } } else { - val parser = EnableArgsParser(onlyQueryIsRequired = true, repo.get(it.chat.id) ?: ChatSettings.DEFAULT) + val parser = EnableArgsParser(onlyQueryIsRequired = true, repo.get(ChatId(it.chat.id.chatId)) ?: ChatSettings.DEFAULT) runCatchingSafely { parser.parse(args) parser.resultSettings @@ -198,11 +198,11 @@ suspend fun main(args: Array) { }.getOrNull() } - triggerSendForChat(it.chat.id, chatSettings ?: return@onCommand) + triggerSendForChat(ChatId(it.chat.id.chatId), chatSettings ?: return@onCommand) } onCommand("disable", requireOnlyCommandInMessage = true) { runCatchingSafely { - repo.unset(it.chat.id) + repo.unset(ChatId(it.chat.id.chatId)) } runCatchingSafely { delete(it)