From 53a443f5d7c4db5f1703537cc517983020c5cdf6 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 18 May 2022 11:15:31 +0000 Subject: [PATCH] deploy: f54843fb602ffd6b88d85212009c8e6b1a7555ec --- .../-companion/index.html | 6 +- .../-companion/invoke.html | 4 +- .../-behaviour-context-with-f-s-m/copy.html | 2 +- .../-behaviour-context-with-f-s-m/index.html | 10 +-- ...-default-behaviour-context-with-f-s-m.html | 4 +- .../copy.html | 2 +- .../index.html | 30 +++++--- .../launch-state-handling.html | 64 +++++++++++++++ ...-default-state-handling-error-handler.html | 64 +++++++++++++++ ...our-with-f-s-m-and-start-long-polling.html | 4 +- .../build-behaviour-with-f-s-m.html | 4 +- .../default-state-handling-error-handler.html | 64 +++++++++++++++ .../index.html | 77 +++++++++++++++---- ...iour-and-f-s-m-and-start-long-polling.html | 4 +- ...telegram-bot-with-behaviour-and-f-s-m.html | 4 +- .../-bot-action/index.html | 4 +- .../-telegram-media-file/index.html | 4 +- ...-app-link.html => check-web-app-data.html} | 10 +-- .../-telegram-a-p-i-urls-keeper/index.html | 8 +- docs/package-list | 23 +++--- navigation.html | 34 ++++---- scripts/pages.json | 2 +- 22 files changed, 344 insertions(+), 84 deletions(-) create mode 100644 docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-default-behaviour-context-with-f-s-m/launch-state-handling.html create mode 100644 docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-default-state-handling-error-handler.html create mode 100644 docs/dev.inmo.tgbotapi.extensions.behaviour_builder/default-state-handling-error-handler.html rename docs/dev.inmo.tgbotapi.utils/-telegram-a-p-i-urls-keeper/{check-web-app-link.html => check-web-app-data.html} (94%) diff --git a/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-behaviour-context-with-f-s-m/-companion/index.html b/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-behaviour-context-with-f-s-m/-companion/index.html index 49dd51db46..72721981f3 100644 --- a/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-behaviour-context-with-f-s-m/-companion/index.html +++ b/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-behaviour-context-with-f-s-m/-companion/index.html @@ -57,19 +57,19 @@ if(savedDarkMode === true){

Functions

-
+
- +
Link copied to clipboard
-
operator fun <T : State> invoke(    behaviourContext: BehaviourContext,     handlers: List<BehaviourWithFSMStateHandlerHolder<*, T>>,     statesManager: StatesManager<T>): DefaultBehaviourContextWithFSM<T>
+
operator fun <T : State> invoke(    behaviourContext: BehaviourContext,     handlers: List<BehaviourWithFSMStateHandlerHolder<*, T>>,     statesManager: StatesManager<T>,     onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler()): DefaultBehaviourContextWithFSM<T>
diff --git a/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-behaviour-context-with-f-s-m/-companion/invoke.html b/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-behaviour-context-with-f-s-m/-companion/invoke.html index 982f43db61..50724d72a2 100644 --- a/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-behaviour-context-with-f-s-m/-companion/invoke.html +++ b/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-behaviour-context-with-f-s-m/-companion/invoke.html @@ -45,14 +45,14 @@ if(savedDarkMode === true){
-
+

invoke

-
operator fun <T : State> invoke(    behaviourContext: BehaviourContext,     handlers: List<BehaviourWithFSMStateHandlerHolder<*, T>>,     statesManager: StatesManager<T>): DefaultBehaviourContextWithFSM<T>
+
operator fun <T : State> invoke(    behaviourContext: BehaviourContext,     handlers: List<BehaviourWithFSMStateHandlerHolder<*, T>>,     statesManager: StatesManager<T>,     onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler()): DefaultBehaviourContextWithFSM<T>
- +
- +
Link copied to clipboard
-
abstract override fun copy(    bot: TelegramBot,     scope: CoroutineScope,     broadcastChannelsSize: Int,     onBufferOverflow: BufferOverflow,     upstreamUpdatesFlow: Flow<Update>?,     triggersHolder: TriggersHolder,     updatesFilter: BehaviourContextAndTypeReceiver<Boolean, Update>?): BehaviourContextWithFSM<T>
+
abstract override fun copy(    bot: TelegramBot,     scope: CoroutineScope,     broadcastChannelsSize: Int,     onBufferOverflow: BufferOverflow,     upstreamUpdatesFlow: Flow<Update>?,     triggersHolder: TriggersHolder,     updatesFilter: BehaviourContextAndTypeReceiver<Boolean, Update>?): BehaviourContextWithFSM<T>
open fun copy(    bot: TelegramBot = this.bot,     scope: CoroutineScope = this.scope,     broadcastChannelsSize: Int = 100,     onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND,     upstreamUpdatesFlow: Flow<Update>? = null,     triggersHolder: TriggersHolder = this.triggersHolder,     onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),     updatesFilter: BehaviourContextAndTypeReceiver<Boolean, Update>? = null): BehaviourContextWithFSM<T>
@@ -188,7 +188,7 @@ if(savedDarkMode === true){
- +
Link copied to clipboard
@@ -196,7 +196,7 @@ if(savedDarkMode === true){
-
open suspend fun launchStateHandling(state: T, handlers: List<CheckableHandlerHolder<in T, T>>): T?
+
open suspend fun launchStateHandling(state: T, handlers: List<CheckableHandlerHolder<in T, T>>): T?
diff --git a/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-default-behaviour-context-with-f-s-m/-default-behaviour-context-with-f-s-m.html b/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-default-behaviour-context-with-f-s-m/-default-behaviour-context-with-f-s-m.html index 7fa3568d18..34167f65f2 100644 --- a/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-default-behaviour-context-with-f-s-m/-default-behaviour-context-with-f-s-m.html +++ b/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-default-behaviour-context-with-f-s-m/-default-behaviour-context-with-f-s-m.html @@ -45,14 +45,14 @@ if(savedDarkMode === true){
-
+

DefaultBehaviourContextWithFSM

-
fun <T : State> DefaultBehaviourContextWithFSM(    behaviourContext: BehaviourContext,     statesManager: StatesManager<T>,     handlers: List<BehaviourWithFSMStateHandlerHolder<*, T>>)
+
fun <T : State> DefaultBehaviourContextWithFSM(    behaviourContext: BehaviourContext,     statesManager: StatesManager<T>,     handlers: List<BehaviourWithFSMStateHandlerHolder<*, T>>,     onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler())

Parameters

onStateHandlingErrorHandler

Will be used in case if state handling has not been successfully completed in launchStateHandling

-
+
+

Parameters

+
+
+
+
onStateHandlingErrorHandler

Will be used in case if state handling has not been successfully completed in launchStateHandling

+

Constructors

-
+
- +
Link copied to clipboard
-
fun <T : State> DefaultBehaviourContextWithFSM(    behaviourContext: BehaviourContext,     statesManager: StatesManager<T>,     handlers: List<BehaviourWithFSMStateHandlerHolder<*, T>>)
+
fun <T : State> DefaultBehaviourContextWithFSM(    behaviourContext: BehaviourContext,     statesManager: StatesManager<T>,     handlers: List<BehaviourWithFSMStateHandlerHolder<*, T>>,     onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler())
@@ -127,19 +133,19 @@ if(savedDarkMode === true){
- +
- +
Link copied to clipboard
-
open override fun copy(    bot: TelegramBot,     scope: CoroutineScope,     broadcastChannelsSize: Int,     onBufferOverflow: BufferOverflow,     upstreamUpdatesFlow: Flow<Update>?,     triggersHolder: TriggersHolder,     updatesFilter: BehaviourContextAndTypeReceiver<Boolean, Update>?): DefaultBehaviourContextWithFSM<T>
+
open override fun copy(    bot: TelegramBot,     scope: CoroutineScope,     broadcastChannelsSize: Int,     onBufferOverflow: BufferOverflow,     upstreamUpdatesFlow: Flow<Update>?,     triggersHolder: TriggersHolder,     updatesFilter: BehaviourContextAndTypeReceiver<Boolean, Update>?): DefaultBehaviourContextWithFSM<T>
open override fun copy(    bot: TelegramBot,     scope: CoroutineScope,     broadcastChannelsSize: Int,     onBufferOverflow: BufferOverflow,     upstreamUpdatesFlow: Flow<Update>?,     triggersHolder: TriggersHolder,     onStateHandlingErrorHandler: StateHandlingErrorHandler<T>,     updatesFilter: BehaviourContextAndTypeReceiver<Boolean, Update>?): DefaultBehaviourContextWithFSM<T>
@@ -178,19 +184,19 @@ if(savedDarkMode === true){
- +
- - + +
Link copied to clipboard
-
open suspend fun launchStateHandling(state: T, handlers: List<CheckableHandlerHolder<in T, T>>): T?
+
open suspend override fun launchStateHandling(state: T, handlers: List<CheckableHandlerHolder<in T, T>>): T?
diff --git a/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-default-behaviour-context-with-f-s-m/launch-state-handling.html b/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-default-behaviour-context-with-f-s-m/launch-state-handling.html new file mode 100644 index 0000000000..af1d9da887 --- /dev/null +++ b/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-default-behaviour-context-with-f-s-m/launch-state-handling.html @@ -0,0 +1,64 @@ + + + + + launchStateHandling + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

launchStateHandling

+
+
+
+
open suspend override fun launchStateHandling(state: T, handlers: List<CheckableHandlerHolder<in T, T>>): T?
+
+ +
+
+ + diff --git a/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-default-state-handling-error-handler.html b/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-default-state-handling-error-handler.html new file mode 100644 index 0000000000..ad4bed5192 --- /dev/null +++ b/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/-default-state-handling-error-handler.html @@ -0,0 +1,64 @@ + + + + + DefaultStateHandlingErrorHandler + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+ +
+

DefaultStateHandlingErrorHandler

+
+
+
+
+
+ +
+
+ + diff --git a/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/build-behaviour-with-f-s-m-and-start-long-polling.html b/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/build-behaviour-with-f-s-m-and-start-long-polling.html index 29101defc4..ca70237413 100644 --- a/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/build-behaviour-with-f-s-m-and-start-long-polling.html +++ b/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/build-behaviour-with-f-s-m-and-start-long-polling.html @@ -45,14 +45,14 @@ if(savedDarkMode === true){
-
+

buildBehaviourWithFSMAndStartLongPolling

-
suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(    upstreamUpdatesFlow: Flow<Update>? = null,     scope: CoroutineScope = defaultCoroutineScopeProvider(),     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): Pair<DefaultBehaviourContextWithFSM<T>, Job>

Use buildBehaviourWithFSM to create BehaviourContextWithFSM and launch getting of updates using longPolling. For longPolling will be used result BehaviourContextWithFSM for both parameters flowsUpdatesFilter and scope


suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(    scope: CoroutineScope = defaultCoroutineScopeProvider(),     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): Job

Use buildBehaviourWithFSM to create BehaviourContextWithFSM and launch getting of updates using longPolling. For longPolling will be used result BehaviourContextWithFSM for both parameters flowsUpdatesFilter and scope

See also

+
suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(    upstreamUpdatesFlow: Flow<Update>? = null,     scope: CoroutineScope = defaultCoroutineScopeProvider(),     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): Pair<DefaultBehaviourContextWithFSM<T>, Job>

Use buildBehaviourWithFSM to create BehaviourContextWithFSM and launch getting of updates using longPolling. For longPolling will be used result BehaviourContextWithFSM for both parameters flowsUpdatesFilter and scope


suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(    scope: CoroutineScope = defaultCoroutineScopeProvider(),     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): Job

Use buildBehaviourWithFSM to create BehaviourContextWithFSM and launch getting of updates using longPolling. For longPolling will be used result BehaviourContextWithFSM for both parameters flowsUpdatesFilter and scope

See also

-
+

buildBehaviourWithFSM

-
suspend fun <T : State> TelegramBot.buildBehaviourWithFSM(    upstreamUpdatesFlow: Flow<Update>? = null,     scope: CoroutineScope = defaultCoroutineScopeProvider(),     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): DefaultBehaviourContextWithFSM<T>

Creates BehaviourContextWithFSM via creating of DefaultBehaviourContext with this as TelegramBot, scope as target scope for that DefaultBehaviourContext and upstreamUpdatesFlow. Pass statesManager to customize some internal logic of states changes. Pass presetHandlers in case you have some list of BehaviourWithFSMStateHandlerHolder with presets.

!!! WARNING !!! This method WILL NOT call BehaviourContextWithFSM.start of result object and WILL NOT start any updates retrieving. See buildBehaviourWithFSMAndStartLongPolling or telegramBotWithBehaviourAndFSMAndStartLongPolling in case you wish to start longPolling automatically


suspend fun <T : State> TelegramBot.buildBehaviourWithFSM(    flowUpdatesFilter: FlowsUpdatesFilter,     scope: CoroutineScope = defaultCoroutineScopeProvider(),     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): DefaultBehaviourContextWithFSM<T>

Creates BehaviourContextWithFSM via creating of DefaultBehaviourContext with this as TelegramBot, scope as target scope for that DefaultBehaviourContext and FlowsUpdatesFilter.allUpdatesFlow of flowUpdatesFilter as DefaultBehaviourContext.upstreamUpdatesFlow. Pass statesManager to customize some internal logic of states changes. Pass presetHandlers in case you have some list of BehaviourWithFSMStateHandlerHolder with presets. Use this method in case you wish to make some additional actions with flowUpdatesFilter.

!!! WARNING !!! This method WILL NOT call BehaviourContextWithFSM.start of result object and WILL NOT start any updates retrieving. See buildBehaviourWithFSMAndStartLongPolling or telegramBotWithBehaviourAndFSMAndStartLongPolling in case you wish to start longPolling automatically

See also

+
suspend fun <T : State> TelegramBot.buildBehaviourWithFSM(    upstreamUpdatesFlow: Flow<Update>? = null,     scope: CoroutineScope = defaultCoroutineScopeProvider(),     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): DefaultBehaviourContextWithFSM<T>

Creates BehaviourContextWithFSM via creating of DefaultBehaviourContext with this as TelegramBot, scope as target scope for that DefaultBehaviourContext and upstreamUpdatesFlow. Pass statesManager to customize some internal logic of states changes. Pass presetHandlers in case you have some list of BehaviourWithFSMStateHandlerHolder with presets.

!!! WARNING !!! This method WILL NOT call BehaviourContextWithFSM.start of result object and WILL NOT start any updates retrieving. See buildBehaviourWithFSMAndStartLongPolling or telegramBotWithBehaviourAndFSMAndStartLongPolling in case you wish to start longPolling automatically


suspend fun <T : State> TelegramBot.buildBehaviourWithFSM(    flowUpdatesFilter: FlowsUpdatesFilter,     scope: CoroutineScope = defaultCoroutineScopeProvider(),     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): DefaultBehaviourContextWithFSM<T>

Creates BehaviourContextWithFSM via creating of DefaultBehaviourContext with this as TelegramBot, scope as target scope for that DefaultBehaviourContext and FlowsUpdatesFilter.allUpdatesFlow of flowUpdatesFilter as DefaultBehaviourContext.upstreamUpdatesFlow. Pass statesManager to customize some internal logic of states changes. Pass presetHandlers in case you have some list of BehaviourWithFSMStateHandlerHolder with presets. Use this method in case you wish to make some additional actions with flowUpdatesFilter.

!!! WARNING !!! This method WILL NOT call BehaviourContextWithFSM.start of result object and WILL NOT start any updates retrieving. See buildBehaviourWithFSMAndStartLongPolling or telegramBotWithBehaviourAndFSMAndStartLongPolling in case you wish to start longPolling automatically

See also

+
+ + + +
+
+
+ + +
Link copied to clipboard
+
+
+
+
+
+
typealias StateHandlingErrorHandler<T> = suspend (T, Throwable) -> T?
@@ -381,36 +398,36 @@ if(savedDarkMode === true){
- +
- +
Link copied to clipboard
-
suspend fun <T : State> TelegramBot.buildBehaviourWithFSM(    flowUpdatesFilter: FlowsUpdatesFilter,     scope: CoroutineScope = defaultCoroutineScopeProvider(),     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): DefaultBehaviourContextWithFSM<T>

Creates BehaviourContextWithFSM via creating of DefaultBehaviourContext with this as TelegramBot, scope as target scope for that DefaultBehaviourContext and FlowsUpdatesFilter.allUpdatesFlow of flowUpdatesFilter as DefaultBehaviourContext.upstreamUpdatesFlow. Pass statesManager to customize some internal logic of states changes. Pass presetHandlers in case you have some list of BehaviourWithFSMStateHandlerHolder with presets. Use this method in case you wish to make some additional actions with flowUpdatesFilter.

suspend fun <T : State> TelegramBot.buildBehaviourWithFSM(    upstreamUpdatesFlow: Flow<Update>? = null,     scope: CoroutineScope = defaultCoroutineScopeProvider(),     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): DefaultBehaviourContextWithFSM<T>

Creates BehaviourContextWithFSM via creating of DefaultBehaviourContext with this as TelegramBot, scope as target scope for that DefaultBehaviourContext and upstreamUpdatesFlow. Pass statesManager to customize some internal logic of states changes. Pass presetHandlers in case you have some list of BehaviourWithFSMStateHandlerHolder with presets.

+
suspend fun <T : State> TelegramBot.buildBehaviourWithFSM(    flowUpdatesFilter: FlowsUpdatesFilter,     scope: CoroutineScope = defaultCoroutineScopeProvider(),     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): DefaultBehaviourContextWithFSM<T>

Creates BehaviourContextWithFSM via creating of DefaultBehaviourContext with this as TelegramBot, scope as target scope for that DefaultBehaviourContext and FlowsUpdatesFilter.allUpdatesFlow of flowUpdatesFilter as DefaultBehaviourContext.upstreamUpdatesFlow. Pass statesManager to customize some internal logic of states changes. Pass presetHandlers in case you have some list of BehaviourWithFSMStateHandlerHolder with presets. Use this method in case you wish to make some additional actions with flowUpdatesFilter.

suspend fun <T : State> TelegramBot.buildBehaviourWithFSM(    upstreamUpdatesFlow: Flow<Update>? = null,     scope: CoroutineScope = defaultCoroutineScopeProvider(),     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): DefaultBehaviourContextWithFSM<T>

Creates BehaviourContextWithFSM via creating of DefaultBehaviourContext with this as TelegramBot, scope as target scope for that DefaultBehaviourContext and upstreamUpdatesFlow. Pass statesManager to customize some internal logic of states changes. Pass presetHandlers in case you have some list of BehaviourWithFSMStateHandlerHolder with presets.

- +
- +
Link copied to clipboard
-
suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(    scope: CoroutineScope = defaultCoroutineScopeProvider(),     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): Job
suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(    upstreamUpdatesFlow: Flow<Update>? = null,     scope: CoroutineScope = defaultCoroutineScopeProvider(),     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): Pair<DefaultBehaviourContextWithFSM<T>, Job>

Use buildBehaviourWithFSM to create BehaviourContextWithFSM and launch getting of updates using longPolling. For longPolling will be used result BehaviourContextWithFSM for both parameters flowsUpdatesFilter and scope

+
suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(    scope: CoroutineScope = defaultCoroutineScopeProvider(),     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): Job
suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(    upstreamUpdatesFlow: Flow<Update>? = null,     scope: CoroutineScope = defaultCoroutineScopeProvider(),     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): Pair<DefaultBehaviourContextWithFSM<T>, Job>

Use buildBehaviourWithFSM to create BehaviourContextWithFSM and launch getting of updates using longPolling. For longPolling will be used result BehaviourContextWithFSM for both parameters flowsUpdatesFilter and scope

@@ -483,6 +500,23 @@ if(savedDarkMode === true){ + +
+
+
+ + +
Link copied to clipboard
+
+
+
+
+
+
inline fun <T> defaultStateHandlingErrorHandler(): StateHandlingErrorHandler<T>
+
+
+
+
@@ -619,36 +653,36 @@ if(savedDarkMode === true){
- +
- +
Link copied to clipboard
-
suspend fun <T : State> telegramBotWithBehaviourAndFSM(    token: String,     flowsUpdatesFilter: FlowsUpdatesFilter,     scope: CoroutineScope? = null,     apiUrl: String = telegramBotAPIDefaultUrl,     builder: KtorRequestsExecutorBuilder.() -> Unit = {},     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     testServer: Boolean = false,     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): TelegramBot

Create bot using telegramBot and start listening for updates using buildBehaviourWithFSM. Use this method in case you wish to make some additional actions with flowsUpdatesFilter.

+
suspend fun <T : State> telegramBotWithBehaviourAndFSM(    token: String,     flowsUpdatesFilter: FlowsUpdatesFilter,     scope: CoroutineScope? = null,     apiUrl: String = telegramBotAPIDefaultUrl,     builder: KtorRequestsExecutorBuilder.() -> Unit = {},     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     testServer: Boolean = false,     onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): TelegramBot

Create bot using telegramBot and start listening for updates using buildBehaviourWithFSM. Use this method in case you wish to make some additional actions with flowsUpdatesFilter.

- +
- +
Link copied to clipboard
-
suspend fun <T : State> telegramBotWithBehaviourAndFSMAndStartLongPolling(    token: String,     scope: CoroutineScope? = null,     apiUrl: String = telegramBotAPIDefaultUrl,     builder: KtorRequestsExecutorBuilder.() -> Unit = {},     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     testServer: Boolean = false,     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): Pair<TelegramBot, Job>

Create bot using telegramBot and start listening for updates using buildBehaviourWithFSMAndStartLongPolling. This method will launch updates retrieving via long polling inside of buildBehaviourWithFSMAndStartLongPolling

+
suspend fun <T : State> telegramBotWithBehaviourAndFSMAndStartLongPolling(    token: String,     scope: CoroutineScope? = null,     apiUrl: String = telegramBotAPIDefaultUrl,     builder: KtorRequestsExecutorBuilder.() -> Unit = {},     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     testServer: Boolean = false,     onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): Pair<TelegramBot, Job>

Create bot using telegramBot and start listening for updates using buildBehaviourWithFSMAndStartLongPolling. This method will launch updates retrieving via long polling inside of buildBehaviourWithFSMAndStartLongPolling

@@ -706,6 +740,23 @@ if(savedDarkMode === true){ + +
+
+
+ + +
Link copied to clipboard
+
+
+
+
+
+
+
+
+
+
diff --git a/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/telegram-bot-with-behaviour-and-f-s-m-and-start-long-polling.html b/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/telegram-bot-with-behaviour-and-f-s-m-and-start-long-polling.html index 1736d02437..830ed2d8cf 100644 --- a/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/telegram-bot-with-behaviour-and-f-s-m-and-start-long-polling.html +++ b/docs/dev.inmo.tgbotapi.extensions.behaviour_builder/telegram-bot-with-behaviour-and-f-s-m-and-start-long-polling.html @@ -45,14 +45,14 @@ if(savedDarkMode === true){
-
+

telegramBotWithBehaviourAndFSMAndStartLongPolling

-
suspend fun <T : State> telegramBotWithBehaviourAndFSMAndStartLongPolling(    token: String,     scope: CoroutineScope? = null,     apiUrl: String = telegramBotAPIDefaultUrl,     builder: KtorRequestsExecutorBuilder.() -> Unit = {},     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     testServer: Boolean = false,     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): Pair<TelegramBot, Job>

Create bot using telegramBot and start listening for updates using buildBehaviourWithFSMAndStartLongPolling. This method will launch updates retrieving via long polling inside of buildBehaviourWithFSMAndStartLongPolling

Return

Pair of TelegramBot and Job. This Job can be used to stop listening updates in your block you passed here

See also

+
suspend fun <T : State> telegramBotWithBehaviourAndFSMAndStartLongPolling(    token: String,     scope: CoroutineScope? = null,     apiUrl: String = telegramBotAPIDefaultUrl,     builder: KtorRequestsExecutorBuilder.() -> Unit = {},     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     testServer: Boolean = false,     onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): Pair<TelegramBot, Job>

Create bot using telegramBot and start listening for updates using buildBehaviourWithFSMAndStartLongPolling. This method will launch updates retrieving via long polling inside of buildBehaviourWithFSMAndStartLongPolling

Return

Pair of TelegramBot and Job. This Job can be used to stop listening updates in your block you passed here

See also

-
+

telegramBotWithBehaviourAndFSM

-
suspend fun <T : State> telegramBotWithBehaviourAndFSM(    token: String,     flowsUpdatesFilter: FlowsUpdatesFilter,     scope: CoroutineScope? = null,     apiUrl: String = telegramBotAPIDefaultUrl,     builder: KtorRequestsExecutorBuilder.() -> Unit = {},     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     testServer: Boolean = false,     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): TelegramBot

Create bot using telegramBot and start listening for updates using buildBehaviourWithFSM. Use this method in case you wish to make some additional actions with flowsUpdatesFilter.

WARNING This method WILL NOT launch any listening of updates. Use something like startGettingOfUpdatesByLongPolling or tools for work with webhooks

Return

Created bot which has been used to create BehaviourContext via buildBehaviourWithFSM

See also

+
suspend fun <T : State> telegramBotWithBehaviourAndFSM(    token: String,     flowsUpdatesFilter: FlowsUpdatesFilter,     scope: CoroutineScope? = null,     apiUrl: String = telegramBotAPIDefaultUrl,     builder: KtorRequestsExecutorBuilder.() -> Unit = {},     defaultExceptionsHandler: ExceptionHandler<Unit>? = null,     statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),     presetHandlers: List<BehaviourWithFSMStateHandlerHolder<*, T>> = listOf(),     testServer: Boolean = false,     onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),     block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>): TelegramBot

Create bot using telegramBot and start listening for updates using buildBehaviourWithFSM. Use this method in case you wish to make some additional actions with flowsUpdatesFilter.

WARNING This method WILL NOT launch any listening of updates. Use something like startGettingOfUpdatesByLongPolling or tools for work with webhooks

Return

Created bot which has been used to create BehaviourContext via buildBehaviourWithFSM

See also

diff --git a/docs/dev.inmo.tgbotapi.types.files/-telegram-media-file/index.html b/docs/dev.inmo.tgbotapi.types.files/-telegram-media-file/index.html index a7ef58f88f..3bb4208271 100644 --- a/docs/dev.inmo.tgbotapi.types.files/-telegram-media-file/index.html +++ b/docs/dev.inmo.tgbotapi.types.files/-telegram-media-file/index.html @@ -321,7 +321,7 @@ if(savedDarkMode === true){
- +
Link copied to clipboard
@@ -329,7 +329,7 @@ if(savedDarkMode === true){
-
inline fun TelegramMediaFile.asDocumentFile(): DocumentFile?
inline fun TelegramMediaFile.asDocumentFile(): DocumentFile
+
inline fun TelegramMediaFile.asDocumentFile(): DocumentFile
inline fun TelegramMediaFile.asDocumentFile(): DocumentFile?
diff --git a/docs/dev.inmo.tgbotapi.utils/-telegram-a-p-i-urls-keeper/check-web-app-link.html b/docs/dev.inmo.tgbotapi.utils/-telegram-a-p-i-urls-keeper/check-web-app-data.html similarity index 94% rename from docs/dev.inmo.tgbotapi.utils/-telegram-a-p-i-urls-keeper/check-web-app-link.html rename to docs/dev.inmo.tgbotapi.utils/-telegram-a-p-i-urls-keeper/check-web-app-data.html index 90d8a64ecc..557754b23f 100644 --- a/docs/dev.inmo.tgbotapi.utils/-telegram-a-p-i-urls-keeper/check-web-app-link.html +++ b/docs/dev.inmo.tgbotapi.utils/-telegram-a-p-i-urls-keeper/check-web-app-data.html @@ -2,7 +2,7 @@ - checkWebAppLink + checkWebAppData