From 4da4e19c817ff1ea7ed0a44a14e630e274792ece Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 14 Jun 2023 13:47:51 +0600 Subject: [PATCH] Update faq.md --- docs/tgbotapi/guides/faq.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/tgbotapi/guides/faq.md b/docs/tgbotapi/guides/faq.md index 97b342e..c80fbe8 100644 --- a/docs/tgbotapi/guides/faq.md +++ b/docs/tgbotapi/guides/faq.md @@ -3,13 +3,14 @@ ## How to filter updates in some part of `BehaviourBuilder`? You may create subcontext with -`BehaviourBuilder.`[`createSubContext`](https://tgbotapi.inmo.dev/tgbotapi.behaviour_builder/dev.inmo.tgbotapi.extensions.behaviour_builder/create-sub-context.html) +`BehaviourBuilder.`[`createSubContextAndDoWithUpdatesFilter`](https://tgbotapi.inmo.dev/tgbotapi.behaviour_builder/dev.inmo.tgbotapi.extensions.behaviour_builder/create-sub-context-and-do-with-updates-filter.html) and pass there `updatesUpstreamFlow` parameter with any operations over parent behaviour builder: ```kotlin buildBehaviourWithLongPolling { - createSubContext( - updatesUpstreamFlow = filter { /* some condition */ } + createSubContextAndDoWithUpdatesFilter( + updatesUpstreamFlow = filter { /* some condition */ }, + stopOnCompletion = false // disable stopping of sub context after setup ) { onCommand() //... }