From 5e52e2c32e6acc5230de7fe4aab567c0800a4140 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 13 Jun 2021 01:35:47 +0600 Subject: [PATCH] actualization --- gradle.properties | 12 ++++++------ .../dev/inmo/plagubot/plugins/captcha/Plugin.kt | 3 +++ .../plugins/captcha/db/CaptchaChatsSettingsRepo.kt | 6 ++++-- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/gradle.properties b/gradle.properties index 2829188..acd64f8 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,13 +4,13 @@ org.gradle.parallel=true kotlin.js.generate.externals=true kotlin.incremental=true -kotlin_version=1.4.32 -kotlin_coroutines_version=1.4.3 -kotlin_serialisation_runtime_version=1.1.0 -plagubot_version=0.2.1 +kotlin_version=1.5.10 +kotlin_coroutines_version=1.5.0 +kotlin_serialisation_runtime_version=1.2.1 +plagubot_version=0.3.0 -micro_utils_version=0.4.36 -tgbotapi_libraries_version=0.0.8-branch_master-build25 +micro_utils_version=0.5.8 +tgbotapi_libraries_version=0.0.9-branch_master-build29 project_group=dev.inmo project_version=0.1.6 diff --git a/src/main/kotlin/dev/inmo/plagubot/plugins/captcha/Plugin.kt b/src/main/kotlin/dev/inmo/plagubot/plugins/captcha/Plugin.kt index b8a28ae..055fad3 100644 --- a/src/main/kotlin/dev/inmo/plagubot/plugins/captcha/Plugin.kt +++ b/src/main/kotlin/dev/inmo/plagubot/plugins/captcha/Plugin.kt @@ -2,6 +2,9 @@ package dev.inmo.plagubot.plugins.captcha import dev.inmo.micro_utils.coroutines.* import dev.inmo.micro_utils.repos.create +import dev.inmo.micro_utils.repos.exposed.keyvalue.ExposedKeyValueRepo +import dev.inmo.micro_utils.repos.versions.KeyValueBasedVersionsRepoProxy +import dev.inmo.micro_utils.repos.versions.StandardVersionsRepo import dev.inmo.plagubot.Plugin import dev.inmo.plagubot.plugins.captcha.db.CaptchaChatsSettingsRepo import dev.inmo.plagubot.plugins.captcha.provider.* diff --git a/src/main/kotlin/dev/inmo/plagubot/plugins/captcha/db/CaptchaChatsSettingsRepo.kt b/src/main/kotlin/dev/inmo/plagubot/plugins/captcha/db/CaptchaChatsSettingsRepo.kt index 4f1369f..821a5d0 100644 --- a/src/main/kotlin/dev/inmo/plagubot/plugins/captcha/db/CaptchaChatsSettingsRepo.kt +++ b/src/main/kotlin/dev/inmo/plagubot/plugins/captcha/db/CaptchaChatsSettingsRepo.kt @@ -1,15 +1,19 @@ package dev.inmo.plagubot.plugins.captcha.db +import dev.inmo.micro_utils.coroutines.launchSynchronously import dev.inmo.micro_utils.repos.exposed.* +import dev.inmo.micro_utils.repos.versions.VersionsRepo import dev.inmo.plagubot.plugins.captcha.provider.CaptchaProvider import dev.inmo.plagubot.plugins.captcha.provider.SimpleCaptchaProvider import dev.inmo.plagubot.plugins.captcha.settings.* import dev.inmo.tgbotapi.types.ChatId import dev.inmo.tgbotapi.types.toChatId +import kotlinx.coroutines.CoroutineScope import kotlinx.serialization.json.Json import org.jetbrains.exposed.sql.* import org.jetbrains.exposed.sql.statements.InsertStatement import org.jetbrains.exposed.sql.statements.UpdateStatement +import org.jetbrains.exposed.sql.transactions.transaction private val captchaProviderSerialFormat = Json { ignoreUnknownKeys = true @@ -33,8 +37,6 @@ class CaptchaChatsSettingsRepo( override val selectByIds: SqlExpressionBuilder.(List) -> Op = { chatIdColumn.inList(it.map { it.chatId }) } - override val InsertStatement.asObject: ChatSettings - get() = TODO("Not yet implemented") override fun insert(value: ChatSettings, it: InsertStatement) { it[chatIdColumn] = value.chatId.chatId