1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-23 00:57:13 +00:00
This commit is contained in:
InsanusMokrassar 2021-10-15 16:37:20 +06:00
parent 179a724d20
commit 19d221fc29
2 changed files with 5 additions and 5 deletions

View File

@ -89,7 +89,7 @@ suspend fun TelegramBot.buildBehaviourWithFSM(
scope: CoroutineScope = defaultCoroutineScopeProvider(),
statesManager: StatesManager = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),
handlersPreset: MutableList<BehaviourWithFSMStateHandlerHolder<*>> = mutableListOf(),
block: suspend BehaviourContextWithFSMBuilder.() -> Unit
block: CustomBehaviourContextReceiver<BehaviourContextWithFSMBuilder, Unit>
) = BehaviourContextWithFSMBuilder(
DefaultBehaviourContext(this, scope, upstreamUpdatesFlow = upstreamUpdatesFlow),
statesManager,
@ -108,7 +108,7 @@ suspend fun TelegramBot.buildBehaviourWithFSMAndLongPolling(
scope: CoroutineScope = defaultCoroutineScopeProvider(),
statesManager: StatesManager = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),
presetHandlers: MutableList<BehaviourWithFSMStateHandlerHolder<*>> = mutableListOf(),
block: suspend BehaviourContextWithFSMBuilder.() -> Unit
block: CustomBehaviourContextReceiver<BehaviourContextWithFSMBuilder, Unit>
) = buildBehaviourWithFSM(upstreamUpdatesFlow, scope, statesManager, presetHandlers, block).run {
this to scope.launch {
start()
@ -169,7 +169,7 @@ suspend fun TelegramBot.buildBehaviourWithFSM(
defaultExceptionsHandler: ExceptionHandler<Unit>? = null,
statesManager: StatesManager = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),
presetHandlers: MutableList<BehaviourWithFSMStateHandlerHolder<*>> = mutableListOf(),
block: BehaviourContextReceiver<Unit>
block: CustomBehaviourContextReceiver<BehaviourContextWithFSMBuilder, Unit>
) = FlowsUpdatesFilter().let {
buildBehaviourWithFSM(
it,

View File

@ -37,7 +37,7 @@ suspend fun telegramBotWithBehaviourAndFSM(
defaultExceptionsHandler: ExceptionHandler<Unit>? = null,
statesManager: StatesManager = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),
presetHandlers: MutableList<BehaviourWithFSMStateHandlerHolder<*>> = mutableListOf(),
block: BehaviourContextReceiver<Unit>
block: CustomBehaviourContextReceiver<BehaviourContextWithFSMBuilder, Unit>
): TelegramBot = telegramBot(
token,
apiUrl,
@ -75,7 +75,7 @@ suspend fun telegramBotWithBehaviourAndFSM(
defaultExceptionsHandler: ExceptionHandler<Unit>? = null,
statesManager: StatesManager = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),
presetHandlers: MutableList<BehaviourWithFSMStateHandlerHolder<*>> = mutableListOf(),
block: BehaviourContextReceiver<Unit>
block: CustomBehaviourContextReceiver<BehaviourContextWithFSMBuilder, Unit>
): Pair<TelegramBot, Job> {
return telegramBot(
token,