buildBehaviourWithFSM

suspend fun TelegramBot.buildBehaviourWithFSM(upstreamUpdatesFlow: Flow<Update>? = null, scope: CoroutineScope = defaultCoroutineScopeProvider(), defaultExceptionsHandler: ExceptionHandler<Unit>? = null, statesManager: StatesManager = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()), presetHandlers: MutableList<BehaviourWithFSMStateHandlerHolder<*>> = mutableListOf(), block: CustomBehaviourContextReceiver<BehaviourContextWithFSMBuilder, Unit>): BehaviourContextWithFSM

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 TelegramBot.buildBehaviourWithFSM(flowUpdatesFilter: FlowsUpdatesFilter, scope: CoroutineScope = defaultCoroutineScopeProvider(), defaultExceptionsHandler: ExceptionHandler<Unit>? = null, statesManager: StatesManager = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()), presetHandlers: MutableList<BehaviourWithFSMStateHandlerHolder<*>> = mutableListOf(), block: CustomBehaviourContextReceiver<BehaviourContextWithFSMBuilder, Unit>): BehaviourContextWithFSM

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