From 19d221fc294f7cd245fd9ed878325831a17e7323 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 15 Oct 2021 16:37:20 +0600 Subject: [PATCH] fixes --- .../behaviour_builder/BehaviourContextWithFSMBuilder.kt | 6 +++--- .../extensions/behaviour_builder/TelegramBotWithFSM.kt | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tgbotapi.extensions.behaviour_builder.fsm/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSMBuilder.kt b/tgbotapi.extensions.behaviour_builder.fsm/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSMBuilder.kt index 96ca461801..17015fe5ee 100644 --- a/tgbotapi.extensions.behaviour_builder.fsm/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSMBuilder.kt +++ b/tgbotapi.extensions.behaviour_builder.fsm/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSMBuilder.kt @@ -89,7 +89,7 @@ suspend fun TelegramBot.buildBehaviourWithFSM( scope: CoroutineScope = defaultCoroutineScopeProvider(), statesManager: StatesManager = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()), handlersPreset: MutableList> = mutableListOf(), - block: suspend BehaviourContextWithFSMBuilder.() -> Unit + block: CustomBehaviourContextReceiver ) = BehaviourContextWithFSMBuilder( DefaultBehaviourContext(this, scope, upstreamUpdatesFlow = upstreamUpdatesFlow), statesManager, @@ -108,7 +108,7 @@ suspend fun TelegramBot.buildBehaviourWithFSMAndLongPolling( scope: CoroutineScope = defaultCoroutineScopeProvider(), statesManager: StatesManager = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()), presetHandlers: MutableList> = mutableListOf(), - block: suspend BehaviourContextWithFSMBuilder.() -> Unit + block: CustomBehaviourContextReceiver ) = buildBehaviourWithFSM(upstreamUpdatesFlow, scope, statesManager, presetHandlers, block).run { this to scope.launch { start() @@ -169,7 +169,7 @@ suspend fun TelegramBot.buildBehaviourWithFSM( defaultExceptionsHandler: ExceptionHandler? = null, statesManager: StatesManager = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()), presetHandlers: MutableList> = mutableListOf(), - block: BehaviourContextReceiver + block: CustomBehaviourContextReceiver ) = FlowsUpdatesFilter().let { buildBehaviourWithFSM( it, diff --git a/tgbotapi.extensions.behaviour_builder.fsm/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBotWithFSM.kt b/tgbotapi.extensions.behaviour_builder.fsm/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBotWithFSM.kt index 23eb0fe7bc..39f4ba3c69 100644 --- a/tgbotapi.extensions.behaviour_builder.fsm/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBotWithFSM.kt +++ b/tgbotapi.extensions.behaviour_builder.fsm/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBotWithFSM.kt @@ -37,7 +37,7 @@ suspend fun telegramBotWithBehaviourAndFSM( defaultExceptionsHandler: ExceptionHandler? = null, statesManager: StatesManager = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()), presetHandlers: MutableList> = mutableListOf(), - block: BehaviourContextReceiver + block: CustomBehaviourContextReceiver ): TelegramBot = telegramBot( token, apiUrl, @@ -75,7 +75,7 @@ suspend fun telegramBotWithBehaviourAndFSM( defaultExceptionsHandler: ExceptionHandler? = null, statesManager: StatesManager = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()), presetHandlers: MutableList> = mutableListOf(), - block: BehaviourContextReceiver + block: CustomBehaviourContextReceiver ): Pair { return telegramBot( token,