mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-08 09:23:47 +00:00
32 lines
16 KiB
Markdown
32 lines
16 KiB
Markdown
|
//[docs](../../index.md)/[dev.inmo.tgbotapi.extensions.behaviour_builder](index.md)
|
||
|
|
||
|
|
||
|
|
||
|
# Package dev.inmo.tgbotapi.extensions.behaviour_builder
|
||
|
|
||
|
|
||
|
## Types
|
||
|
|
||
|
| Name | Summary |
|
||
|
|---|---|
|
||
|
| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder/BehaviourContext///PointingToDeclaration/"></a>[BehaviourContext](-behaviour-context/index.md)| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder/BehaviourContext///PointingToDeclaration/"></a>[common] <br>Content <br>data class [BehaviourContext](-behaviour-context/index.md)(**bot**: [TelegramBot](../dev.inmo.tgbotapi.bot/index.md#%5Bdev.inmo.tgbotapi.bot%2FTelegramBot%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081), **scope**: , **flowsUpdatesFilter**: [FlowsUpdatesFilter](../dev.inmo.tgbotapi.updateshandlers/-flows-updates-filter/index.md)) : [FlowsUpdatesFilter](../dev.inmo.tgbotapi.updateshandlers/-flows-updates-filter/index.md), [RequestsExecutor](../dev.inmo.tgbotapi.bot/-requests-executor/index.md), <br>More info <br>This class contains all necessary tools for work with bots and especially for [buildBehaviour](build-behaviour.md) <br><br><br>|
|
||
|
| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder/BehaviourContextAndTypeReceiver///PointingToDeclaration/"></a>[BehaviourContextAndTypeReceiver](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextAndTypeReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081)| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder/BehaviourContextAndTypeReceiver///PointingToDeclaration/"></a>[common] <br>Content <br>typealias [BehaviourContextAndTypeReceiver](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextAndTypeReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081)<[T](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextAndTypeReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081), [I](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextAndTypeReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081)> = suspend [BehaviourContext](-behaviour-context/index.md).([I](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextAndTypeReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081)) -> [T](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextAndTypeReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081) <br><br><br>|
|
||
|
| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder/BehaviourContextReceiver///PointingToDeclaration/"></a>[BehaviourContextReceiver](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081)| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder/BehaviourContextReceiver///PointingToDeclaration/"></a>[common] <br>Content <br>typealias [BehaviourContextReceiver](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081)<[T](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081)> = suspend [BehaviourContext](-behaviour-context/index.md).() -> [T](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081) <br><br><br>|
|
||
|
|
||
|
|
||
|
## Functions
|
||
|
|
||
|
| Name | Summary |
|
||
|
|---|---|
|
||
|
| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//asAction/kotlinx.coroutines.Deferred[TypeParam(bounds=[kotlin.Any?])]#/PointingToDeclaration/"></a>[asAction](as-action.md)| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//asAction/kotlinx.coroutines.Deferred[TypeParam(bounds=[kotlin.Any?])]#/PointingToDeclaration/"></a>[common] <br>Content <br>inline fun <[T](as-action.md)> <[T](as-action.md)>.[asAction](as-action.md)(): <[T](as-action.md), [T](as-action.md)> <br><br><br>|
|
||
|
| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//buildBehaviour/dev.inmo.tgbotapi.bot.RequestsExecutor#kotlinx.coroutines.CoroutineScope#kotlin.coroutines.SuspendFunction1[dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext,kotlin.Unit]/PointingToDeclaration/"></a>[buildBehaviour](build-behaviour.md)| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//buildBehaviour/dev.inmo.tgbotapi.bot.RequestsExecutor#kotlinx.coroutines.CoroutineScope#kotlin.coroutines.SuspendFunction1[dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext,kotlin.Unit]/PointingToDeclaration/"></a>[common] <br>Content <br>suspend fun [TelegramBot](../dev.inmo.tgbotapi.bot/index.md#%5Bdev.inmo.tgbotapi.bot%2FTelegramBot%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081).[buildBehaviour](build-behaviour.md)(scope: , block: [BehaviourContextReceiver](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081)<[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)>): <br>More info <br>Use this method to build bot behaviour and run it via long polling. <br><br><br>[common] <br>Content <br>suspend fun [TelegramBot](../dev.inmo.tgbotapi.bot/index.md#%5Bdev.inmo.tgbotapi.bot%2FTelegramBot%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081).[buildBehaviour](build-behaviour.md)(scope: , flowUpdatesFilter: [FlowsUpdatesFilter](../dev.inmo.tgbotapi.updateshandlers/-flows-updates-filter/index.md), block: [BehaviourContextReceiver](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081)<[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html)>) <br>More info <br>Use this method in case you wish to make some additional actions with [flowUpdatesFilter](build-behaviour.md). <br><br><br>|
|
||
|
| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//doInSubContext/dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext#kotlin.Boolean#kotlin.coroutines.SuspendFunction1[dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext,TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration/"></a>[doInSubContext](do-in-sub-context.md)| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//doInSubContext/dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext#kotlin.Boolean#kotlin.coroutines.SuspendFunction1[dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext,TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration/"></a>[common] <br>Content <br>suspend fun <[T](do-in-sub-context.md)> [BehaviourContext](-behaviour-context/index.md).[doInSubContext](do-in-sub-context.md)(stopOnCompletion: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) = true, behaviourContextReceiver: [BehaviourContextReceiver](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081)<[T](do-in-sub-context.md)>): [T](do-in-sub-context.md) <br><br><br>|
|
||
|
| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//doInSubContextWithFlowsUpdatesFilterSetup/dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext#kotlin.coroutines.SuspendFunction2[dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext,dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter,kotlin.Unit]?#kotlin.Boolean#kotlin.coroutines.SuspendFunction1[dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext,TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration/"></a>[doInSubContextWithFlowsUpdatesFilterSetup](do-in-sub-context-with-flows-updates-filter-setup.md)| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//doInSubContextWithFlowsUpdatesFilterSetup/dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext#kotlin.coroutines.SuspendFunction2[dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext,dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter,kotlin.Unit]?#kotlin.Boolean#kotlin.coroutines.SuspendFunction1[dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext,TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration/"></a>[common] <br>Content <br>suspend fun <[T](do-in-sub-context-with-flows-updates-filter-setup.md)> [BehaviourContext](-behaviour-context/index.md).[doInSubContextWithFlowsUpdatesFilterSetup](do-in-sub-context-with-flows-updates-filter-setup.md)(newFlowsUpdatesFilterSetUp: [BehaviourContextAndTypeReceiver](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextAndTypeReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081)<[Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html), [FlowsUpdatesFilter](../dev.inmo.tgbotapi.updateshandlers/-flows-updates-filter/index.md)>?, stopOnCompletion: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) = true, behaviourContextReceiver: [BehaviourContextReceiver](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081)<[T](do-in-sub-context-with-flows-updates-filter-setup.md)>): [T](do-in-sub-context-with-flows-updates-filter-setup.md) <br>More info <br>Creates new one [BehaviourContext](-behaviour-context/index.md), adding subsequent [FlowsUpdatesFilter](../dev.inmo.tgbotapi.updateshandlers/-flows-updates-filter/index.md) in case [newFlowsUpdatesFilterSetUp](do-in-sub-context-with-flows-updates-filter-setup.md) is provided and as new [BehaviourContext.scope](-behaviour-context/scope.md). <br><br><br>|
|
||
|
| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//doInSubContextWithUpdatesFilter/dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext#kotlin.coroutines.SuspendFunction2[dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext,dev.inmo.tgbotapi.types.update.abstracts.Update,kotlin.Boolean]?#kotlin.Boolean#kotlin.coroutines.SuspendFunction1[dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext,TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration/"></a>[doInSubContextWithUpdatesFilter](do-in-sub-context-with-updates-filter.md)| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//doInSubContextWithUpdatesFilter/dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext#kotlin.coroutines.SuspendFunction2[dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext,dev.inmo.tgbotapi.types.update.abstracts.Update,kotlin.Boolean]?#kotlin.Boolean#kotlin.coroutines.SuspendFunction1[dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext,TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration/"></a>[common] <br>Content <br>suspend fun <[T](do-in-sub-context-with-updates-filter.md)> [BehaviourContext](-behaviour-context/index.md).[doInSubContextWithUpdatesFilter](do-in-sub-context-with-updates-filter.md)(updatesFilter: [BehaviourContextAndTypeReceiver](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextAndTypeReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081)<[Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html), [Update](../dev.inmo.tgbotapi.types.update.abstracts/-update/index.md)>?, stopOnCompletion: [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) = true, behaviourContextReceiver: [BehaviourContextReceiver](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081)<[T](do-in-sub-context-with-updates-filter.md)>): [T](do-in-sub-context-with-updates-filter.md) <br>More info <br>Creates new one [BehaviourContext](-behaviour-context/index.md), adding subsequent [FlowsUpdatesFilter](../dev.inmo.tgbotapi.updateshandlers/-flows-updates-filter/index.md) in case [updatesFilter](do-in-sub-context-with-updates-filter.md) is provided and as new [BehaviourContext.scope](-behaviour-context/scope.md) <br><br><br>|
|
||
|
| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//oneOf/dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext#kotlin.Array[kotlinx.coroutines.Deferred[TypeParam(bounds=[kotlin.Any?])]]/PointingToDeclaration/"></a>[oneOf](one-of.md)| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//oneOf/dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext#kotlin.Array[kotlinx.coroutines.Deferred[TypeParam(bounds=[kotlin.Any?])]]/PointingToDeclaration/"></a>[common] <br>Content <br>suspend fun <[O](one-of.md)> [BehaviourContext](-behaviour-context/index.md).[oneOf](one-of.md)(vararg deferredActions: <[O](one-of.md)>): [O](one-of.md) <br>suspend fun <[O](one-of.md)> [BehaviourContext](-behaviour-context/index.md).[oneOf](one-of.md)(deferredActions: [Iterable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/index.html)<<[O](one-of.md)>>): [O](one-of.md) <br><br><br>|
|
||
|
| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//oneOfActions/dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext#kotlin.Array[dev.inmo.micro_utils.coroutines.DeferredAction[*,TypeParam(bounds=[kotlin.Any?])]]/PointingToDeclaration/"></a>[oneOfActions](one-of-actions.md)| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//oneOfActions/dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext#kotlin.Array[dev.inmo.micro_utils.coroutines.DeferredAction[*,TypeParam(bounds=[kotlin.Any?])]]/PointingToDeclaration/"></a>[common] <br>Content <br>suspend fun <[O](one-of-actions.md)> [BehaviourContext](-behaviour-context/index.md).[oneOfActions](one-of-actions.md)(vararg deferredActions: <*, [O](one-of-actions.md)>): [O](one-of-actions.md) <br>suspend fun <[O](one-of-actions.md)> [BehaviourContext](-behaviour-context/index.md).[oneOfActions](one-of-actions.md)(deferredActions: [Iterable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-iterable/index.html)<<*, [O](one-of-actions.md)>>): [O](one-of-actions.md) <br><br><br>|
|
||
|
| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//parallel/dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext#kotlin.coroutines.SuspendFunction1[dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext,TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration/"></a>[parallel](parallel.md)| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//parallel/dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext#kotlin.coroutines.SuspendFunction1[dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext,TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration/"></a>[common] <br>Content <br>suspend fun <[T](parallel.md)> [BehaviourContext](-behaviour-context/index.md).[parallel](parallel.md)(action: [BehaviourContextReceiver](index.md#%5Bdev.inmo.tgbotapi.extensions.behaviour_builder%2FBehaviourContextReceiver%2F%2F%2FPointingToDeclaration%2F%5D%2FClasslikes%2F625018081)<[T](parallel.md)>): <[T](parallel.md)> <br><br><br>|
|
||
|
| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//stop/dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext#/PointingToDeclaration/"></a>[stop](stop.md)| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//stop/dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext#/PointingToDeclaration/"></a>[common] <br>Content <br>fun [BehaviourContext](-behaviour-context/index.md).[stop](stop.md)() <br>More info <br>This method will cancel ALL subsequent contexts, expectations and waiters <br><br><br>|
|
||
|
| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//withAction/kotlinx.coroutines.Deferred[TypeParam(bounds=[kotlin.Any?])]#kotlin.coroutines.SuspendFunction1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration/"></a>[withAction](with-action.md)| <a name="dev.inmo.tgbotapi.extensions.behaviour_builder//withAction/kotlinx.coroutines.Deferred[TypeParam(bounds=[kotlin.Any?])]#kotlin.coroutines.SuspendFunction1[TypeParam(bounds=[kotlin.Any?]),TypeParam(bounds=[kotlin.Any?])]/PointingToDeclaration/"></a>[common] <br>Content <br>infix inline fun <[T](with-action.md), [O](with-action.md)> <[T](with-action.md)>.[withAction](with-action.md)(noinline callback: suspend ([T](with-action.md)) -> [O](with-action.md)): <[T](with-action.md), [O](with-action.md)> <br><br><br>|
|
||
|
|