diff --git a/bot/src/main/kotlin/dev/inmo/plagubot/App.kt b/bot/src/main/kotlin/dev/inmo/plagubot/App.kt index 9c5b12f..133d990 100644 --- a/bot/src/main/kotlin/dev/inmo/plagubot/App.kt +++ b/bot/src/main/kotlin/dev/inmo/plagubot/App.kt @@ -5,18 +5,6 @@ import kotlinx.coroutines.* import kotlinx.serialization.InternalSerializationApi import java.io.File -@Deprecated( - "This method is redundant due to new class PlaguBot", - ReplaceWith( - "PlaguBot(config).start(scope)", - "dev.inmo.plagubot.PlaguBot" - ) -) -suspend inline fun initPlaguBot( - config: Config, - scope: CoroutineScope = CoroutineScope(Dispatchers.Default) -): Job = PlaguBot(config).start(scope) - /** * This method by default expects one argument in [args] field: path to config */ diff --git a/bot/src/main/kotlin/dev/inmo/plagubot/PlaguBot.kt b/bot/src/main/kotlin/dev/inmo/plagubot/PlaguBot.kt index 98dae72..5cfa092 100644 --- a/bot/src/main/kotlin/dev/inmo/plagubot/PlaguBot.kt +++ b/bot/src/main/kotlin/dev/inmo/plagubot/PlaguBot.kt @@ -4,8 +4,7 @@ import dev.inmo.micro_utils.coroutines.safelyWithoutExceptions import dev.inmo.plagubot.config.* import dev.inmo.tgbotapi.bot.Ktor.telegramBot import dev.inmo.tgbotapi.extensions.api.bot.setMyCommands -import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext -import dev.inmo.tgbotapi.extensions.behaviour_builder.buildBehaviour +import dev.inmo.tgbotapi.extensions.behaviour_builder.* import dev.inmo.tgbotapi.types.BotCommand import dev.inmo.tgbotapi.types.botCommandsLimit import kotlinx.coroutines.* @@ -50,7 +49,7 @@ data class PlaguBot( */ suspend fun start( scope: CoroutineScope = CoroutineScope(Dispatchers.Default) - ): Job = bot.buildBehaviour(scope) { + ): Job = bot.buildBehaviourWithLongPolling(scope) { invoke(database, paramsMap) } } diff --git a/gradle.properties b/gradle.properties index e5ff9c7..3dd3d62 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,17 +6,17 @@ kotlin.incremental=true kotlin_version=1.5.31 kotlin_coroutines_version=1.5.2 -kotlin_serialisation_runtime_version=1.2.2 -kotlin_exposed_version=0.34.2 +kotlin_serialisation_runtime_version=1.3.1 +kotlin_exposed_version=0.36.1 -sdi_version=0.5.0 -tgbotapi_version=0.35.9 -microutils_version=0.5.28 +sdi_version=0.6.0 +tgbotapi_version=0.37.0 +microutils_version=0.8.2 klassindex_version=4.1.0-rc.1 -sqlite_version=3.34.0 +sqlite_version=3.36.0.3 github_release_plugin_version=2.2.12 group=dev.inmo -version=0.3.2 +version=0.4.0 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 442d913..e750102 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-6.8.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists