1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-09-03 23:29:33 +00:00

Merge branch 'master' into 1.0.0

This commit is contained in:
2022-05-02 13:50:31 +06:00
7 changed files with 37 additions and 9 deletions

View File

@@ -38,10 +38,12 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSM(
defaultExceptionsHandler: ExceptionHandler<Unit>? = null,
statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),
presetHandlers: MutableList<BehaviourWithFSMStateHandlerHolder<*, T>> = mutableListOf(),
testServer: Boolean = false,
block: CustomBehaviourContextReceiver<BehaviourContextWithFSMBuilder<T>, Unit>
): TelegramBot = telegramBot(
token,
apiUrl,
testServer,
builder
).apply {
buildBehaviourWithFSMAndStartLongPolling(
@@ -73,11 +75,13 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSMAndStartLongPolling(
defaultExceptionsHandler: ExceptionHandler<Unit>? = null,
statesManager: StatesManager<T> = DefaultStatesManager(InMemoryDefaultStatesManagerRepo()),
presetHandlers: MutableList<BehaviourWithFSMStateHandlerHolder<*, T>> = mutableListOf(),
testServer: Boolean = false,
block: CustomBehaviourContextReceiver<BehaviourContextWithFSMBuilder<T>, Unit>
): Pair<TelegramBot, Job> {
return telegramBot(
token,
apiUrl,
testServer,
builder
).let {
it to it.buildBehaviourWithFSMAndStartLongPolling (