diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt index 2426853a51..ccc6ccbbd5 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt @@ -128,7 +128,7 @@ suspend fun BC.doInSubContextWithUpdatesFilter( upstreamUpdatesFlow = updatesUpstreamFlow ).run { withContext(coroutineContext) { - behaviourContextReceiver().also { if (stopOnCompletion) stop() } + (this@run as BC).behaviourContextReceiver().also { if (stopOnCompletion) stop() } } }