mirror of
https://github.com/InsanusMokrassar/docs.git
synced 2024-11-26 12:08:55 +00:00
Update faq.md
This commit is contained in:
parent
fa924076be
commit
4da4e19c81
@ -3,13 +3,14 @@
|
|||||||
## How to filter updates in some part of `BehaviourBuilder`?
|
## How to filter updates in some part of `BehaviourBuilder`?
|
||||||
|
|
||||||
You may create subcontext with
|
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:
|
and pass there `updatesUpstreamFlow` parameter with any operations over parent behaviour builder:
|
||||||
|
|
||||||
```kotlin
|
```kotlin
|
||||||
buildBehaviourWithLongPolling {
|
buildBehaviourWithLongPolling {
|
||||||
createSubContext(
|
createSubContextAndDoWithUpdatesFilter(
|
||||||
updatesUpstreamFlow = filter { /* some condition */ }
|
updatesUpstreamFlow = filter { /* some condition */ },
|
||||||
|
stopOnCompletion = false // disable stopping of sub context after setup
|
||||||
) {
|
) {
|
||||||
onCommand() //...
|
onCommand() //...
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user