docs

# 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(), onStateHandlingErrorHandler: StateHandlingErrorHandler< T > = defaultStateHandlingErrorHandler(), block: CustomBehaviourContextReceiver < DefaultBehaviourContextWithFSM < T >, Unit >): Pair < DefaultBehaviourContextWithFSM < T >, Job>
Content copied to clipboard

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
Content copied to clipboard

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

buildBehaviourWithFSMAndStartLongPolling
dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
longPolling
BehaviourContextWithFSM.strictlyOn
BehaviourContextWithFSM.onStateOrSubstate