mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-06-11 01:57:23 +00:00
Compare commits
1 Commits
28.0.2
...
16eaef0b9c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
16eaef0b9c |
26
CHANGELOG.md
26
CHANGELOG.md
@@ -1,31 +1,5 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
## 28.0.2
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* [#1001](https://github.com/InsanusMokrassar/ktgbotapi/issues/1001) - `[Bug] Invalid detection of isCausedByCancellation()`
|
|
||||||
* [#1002](https://github.com/InsanusMokrassar/ktgbotapi/issues/1002) - `Unable to handle UnauthorizedException with buildBehaviourWithLongPolling`
|
|
||||||
|
|
||||||
## 28.0.1
|
|
||||||
|
|
||||||
* `Version`:
|
|
||||||
* `Kotlin`: `2.2.0` -> `2.2.10`
|
|
||||||
* `MicroUtils`: `0.26.2` -> `0.26.3`
|
|
||||||
* `Ktor`: `3.2.2` -> `3.2.3`
|
|
||||||
* `Core`:
|
|
||||||
* Let all `OptionallyMessageThreadRequest` inheritors to use `@EncodeDefault` annotation to fix default value passing
|
|
||||||
|
|
||||||
## 28.0.0
|
|
||||||
|
|
||||||
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
|
||||||
|
|
||||||
* `Core`:
|
|
||||||
* Add `firstOf` extension
|
|
||||||
* `BehaviourBuilder`:
|
|
||||||
* All builders for behaviours got boolean `useDefaultSubcontextInitialAction`
|
|
||||||
* Add opportunity to pass `BehaviourContextData` in `DefaultBehaviourContext` constructor and `copy` method
|
|
||||||
* By default, commands to other bots will be ignored in triggers and waiters
|
|
||||||
|
|
||||||
## 27.1.2
|
## 27.1.2
|
||||||
|
|
||||||
* `Core`:
|
* `Core`:
|
||||||
|
|||||||
@@ -9,4 +9,4 @@ kotlin.incremental.js=true
|
|||||||
ksp.useKSP2=false
|
ksp.useKSP2=false
|
||||||
|
|
||||||
library_group=dev.inmo
|
library_group=dev.inmo
|
||||||
library_version=28.0.2
|
library_version=27.1.2
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[versions]
|
[versions]
|
||||||
|
|
||||||
kotlin = "2.2.10"
|
kotlin = "2.2.0"
|
||||||
kotlin-serialization = "1.9.0"
|
kotlin-serialization = "1.9.0"
|
||||||
kotlin-coroutines = "1.10.2"
|
kotlin-coroutines = "1.10.2"
|
||||||
|
|
||||||
@@ -10,10 +10,10 @@ korlibs = "5.4.0"
|
|||||||
uuid = "0.8.4"
|
uuid = "0.8.4"
|
||||||
ktor = "3.2.3"
|
ktor = "3.2.3"
|
||||||
|
|
||||||
ksp = "2.2.10-2.0.2"
|
ksp = "2.2.0-2.0.2"
|
||||||
kotlin-poet = "2.2.0"
|
kotlin-poet = "2.2.0"
|
||||||
|
|
||||||
microutils = "0.26.3"
|
microutils = "0.26.2"
|
||||||
kslog = "1.5.0"
|
kslog = "1.5.0"
|
||||||
|
|
||||||
versions = "0.52.0"
|
versions = "0.52.0"
|
||||||
@@ -22,7 +22,7 @@ github-release-plugin = "2.5.2"
|
|||||||
dokka = "2.0.0"
|
dokka = "2.0.0"
|
||||||
|
|
||||||
validator = "0.18.1"
|
validator = "0.18.1"
|
||||||
nmcp = "1.1.0"
|
nmcp = "1.0.2"
|
||||||
|
|
||||||
[libraries]
|
[libraries]
|
||||||
|
|
||||||
|
|||||||
@@ -35,14 +35,14 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourConte
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSMBuilderKt {
|
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSMBuilderKt {
|
||||||
public static final fun buildBehaviourWithFSM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
public static final fun buildBehaviourWithFSM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
public static final fun buildBehaviourWithFSM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
public static final fun buildBehaviourWithFSM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
public static synthetic fun buildBehaviourWithFSM$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
public static synthetic fun buildBehaviourWithFSM$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||||
public static synthetic fun buildBehaviourWithFSM$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
public static synthetic fun buildBehaviourWithFSM$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||||
public static final fun buildBehaviourWithFSMAndStartLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
public static final fun buildBehaviourWithFSMAndStartLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
public static final fun buildBehaviourWithFSMAndStartLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
public static final fun buildBehaviourWithFSMAndStartLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
public static synthetic fun buildBehaviourWithFSMAndStartLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
public static synthetic fun buildBehaviourWithFSMAndStartLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||||
public static synthetic fun buildBehaviourWithFSMAndStartLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
public static synthetic fun buildBehaviourWithFSMAndStartLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/flow/Flow;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;Lkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSMKt {
|
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextWithFSMKt {
|
||||||
@@ -128,9 +128,9 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehavio
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBotWithFSMKt {
|
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBotWithFSMKt {
|
||||||
public static final fun telegramBotWithBehaviourAndFSM (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
public static final fun telegramBotWithBehaviourAndFSM (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
public static synthetic fun telegramBotWithBehaviourAndFSM$default (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
public static synthetic fun telegramBotWithBehaviourAndFSM$default (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||||
public static final fun telegramBotWithBehaviourAndFSMAndStartLongPolling (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
public static final fun telegramBotWithBehaviourAndFSMAndStartLongPolling (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
public static synthetic fun telegramBotWithBehaviourAndFSMAndStartLongPolling$default (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
public static synthetic fun telegramBotWithBehaviourAndFSMAndStartLongPolling$default (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;Ldev/inmo/micro_utils/fsm/common/StatesManager;Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourWithFSMStateHandlerHolder;ZLkotlin/jvm/functions/Function3;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update
|
|||||||
import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter
|
import dev.inmo.tgbotapi.updateshandlers.FlowsUpdatesFilter
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.emptyFlow
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates [BehaviourContextWithFSM] via creating of [DefaultBehaviourContext] with [this] as [TelegramBot],
|
* Creates [BehaviourContextWithFSM] via creating of [DefaultBehaviourContext] with [this] as [TelegramBot],
|
||||||
@@ -36,14 +35,12 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSM(
|
|||||||
onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),
|
onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),
|
||||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||||
useDefaultSubcontextInitialAction: Boolean = true,
|
|
||||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||||
): DefaultBehaviourContextWithFSM<T> = BehaviourContextWithFSM(
|
): DefaultBehaviourContextWithFSM<T> = BehaviourContextWithFSM(
|
||||||
behaviourContext = BehaviourContext(
|
behaviourContext = DefaultBehaviourContext(
|
||||||
bot = this,
|
bot = this,
|
||||||
scope = defaultExceptionsHandler ?.let { scope + ContextSafelyExceptionHandler(it) } ?: scope,
|
scope = defaultExceptionsHandler ?.let { scope + ContextSafelyExceptionHandler(it) } ?: scope,
|
||||||
upstreamUpdatesFlow = upstreamUpdatesFlow ?: emptyFlow(),
|
upstreamUpdatesFlow = upstreamUpdatesFlow,
|
||||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
|
||||||
subcontextInitialAction = subcontextInitialAction
|
subcontextInitialAction = subcontextInitialAction
|
||||||
),
|
),
|
||||||
handlers = presetHandlers,
|
handlers = presetHandlers,
|
||||||
@@ -76,7 +73,6 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(
|
|||||||
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
||||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||||
useDefaultSubcontextInitialAction: Boolean = true,
|
|
||||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||||
): Pair<DefaultBehaviourContextWithFSM<T>, Job> = buildBehaviourWithFSM(
|
): Pair<DefaultBehaviourContextWithFSM<T>, Job> = buildBehaviourWithFSM(
|
||||||
upstreamUpdatesFlow = upstreamUpdatesFlow,
|
upstreamUpdatesFlow = upstreamUpdatesFlow,
|
||||||
@@ -88,7 +84,6 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(
|
|||||||
onStateHandlingErrorHandler = onStateHandlingErrorHandler,
|
onStateHandlingErrorHandler = onStateHandlingErrorHandler,
|
||||||
subcontextInitialAction = subcontextInitialAction,
|
subcontextInitialAction = subcontextInitialAction,
|
||||||
stateInitialAction = stateInitialAction,
|
stateInitialAction = stateInitialAction,
|
||||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
|
||||||
block = block
|
block = block
|
||||||
).run {
|
).run {
|
||||||
this to scope.launch {
|
this to scope.launch {
|
||||||
@@ -125,15 +120,13 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSM(
|
|||||||
onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),
|
onStateHandlingErrorHandler: StateHandlingErrorHandler<T> = defaultStateHandlingErrorHandler(),
|
||||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||||
useDefaultSubcontextInitialAction: Boolean = true,
|
|
||||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||||
): DefaultBehaviourContextWithFSM<T> = BehaviourContextWithFSM(
|
): DefaultBehaviourContextWithFSM<T> = BehaviourContextWithFSM(
|
||||||
BehaviourContext(
|
DefaultBehaviourContext(
|
||||||
this,
|
this,
|
||||||
defaultExceptionsHandler ?.let { scope + ContextSafelyExceptionHandler(it) } ?: scope,
|
defaultExceptionsHandler ?.let { scope + ContextSafelyExceptionHandler(it) } ?: scope,
|
||||||
upstreamUpdatesFlow = flowUpdatesFilter.allUpdatesFlow,
|
upstreamUpdatesFlow = flowUpdatesFilter.allUpdatesFlow,
|
||||||
subcontextInitialAction = subcontextInitialAction,
|
subcontextInitialAction = subcontextInitialAction
|
||||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction
|
|
||||||
),
|
),
|
||||||
presetHandlers,
|
presetHandlers,
|
||||||
statesManager,
|
statesManager,
|
||||||
@@ -170,7 +163,6 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(
|
|||||||
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
||||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||||
useDefaultSubcontextInitialAction: Boolean = true,
|
|
||||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||||
) = FlowsUpdatesFilter().let {
|
) = FlowsUpdatesFilter().let {
|
||||||
buildBehaviourWithFSM(
|
buildBehaviourWithFSM(
|
||||||
@@ -183,7 +175,6 @@ suspend fun <T : State> TelegramBot.buildBehaviourWithFSMAndStartLongPolling(
|
|||||||
onStateHandlingErrorHandler = onStateHandlingErrorHandler,
|
onStateHandlingErrorHandler = onStateHandlingErrorHandler,
|
||||||
subcontextInitialAction = subcontextInitialAction,
|
subcontextInitialAction = subcontextInitialAction,
|
||||||
stateInitialAction = stateInitialAction,
|
stateInitialAction = stateInitialAction,
|
||||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
|
||||||
block = block
|
block = block
|
||||||
).run {
|
).run {
|
||||||
start()
|
start()
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSM(
|
|||||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||||
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
|
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
|
||||||
useDefaultSubcontextInitialAction: Boolean = true,
|
|
||||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||||
): TelegramBot = telegramBot(
|
): TelegramBot = telegramBot(
|
||||||
token,
|
token,
|
||||||
@@ -81,7 +80,6 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSM(
|
|||||||
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
|
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
|
||||||
subcontextInitialAction = subcontextInitialAction,
|
subcontextInitialAction = subcontextInitialAction,
|
||||||
stateInitialAction = stateInitialAction,
|
stateInitialAction = stateInitialAction,
|
||||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
|
||||||
block = block
|
block = block
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -119,7 +117,6 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSMAndStartLongPolling(
|
|||||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||||
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
stateInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContextWithFSM<T>, Unit, T> = {},
|
||||||
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
|
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
|
||||||
useDefaultSubcontextInitialAction: Boolean = true,
|
|
||||||
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
block: CustomBehaviourContextReceiver<DefaultBehaviourContextWithFSM<T>, Unit>
|
||||||
): Pair<TelegramBot, Job> {
|
): Pair<TelegramBot, Job> {
|
||||||
return telegramBot(
|
return telegramBot(
|
||||||
@@ -142,7 +139,6 @@ suspend fun <T : State> telegramBotWithBehaviourAndFSMAndStartLongPolling(
|
|||||||
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
|
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
|
||||||
subcontextInitialAction = subcontextInitialAction,
|
subcontextInitialAction = subcontextInitialAction,
|
||||||
stateInitialAction = stateInitialAction,
|
stateInitialAction = stateInitialAction,
|
||||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
|
||||||
block = block
|
block = block
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourBuildersKt {
|
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourBuildersKt {
|
||||||
public static final fun buildBehaviour (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
public static final fun buildBehaviour (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
public static synthetic fun buildBehaviour$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
public static synthetic fun buildBehaviour$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||||
public static final fun buildBehaviourWithLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
public static final fun buildBehaviourWithLongPolling (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
public static synthetic fun buildBehaviourWithLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
public static synthetic fun buildBehaviourWithLongPolling$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlin/jvm/functions/Function2;IZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract interface class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext : dev/inmo/tgbotapi/bot/RequestsExecutor, dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter, kotlinx/coroutines/CoroutineScope {
|
public abstract interface class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext : dev/inmo/tgbotapi/bot/RequestsExecutor, dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter, kotlinx/coroutines/CoroutineScope {
|
||||||
@@ -64,18 +64,13 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourConte
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextKt {
|
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextKt {
|
||||||
public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
|
||||||
public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;ZLkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
|
public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
||||||
public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function1;)Ljava/lang/Object;
|
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
|
||||||
public static final fun BehaviourContext (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Z)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
|
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/Object;
|
||||||
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/Object;
|
|
||||||
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
|
|
||||||
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ZLkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ljava/lang/Object;
|
|
||||||
public static synthetic fun BehaviourContext$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;ZILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
|
|
||||||
public static final fun BehaviourContextAndTwoTypesReceiver (Lkotlin/jvm/functions/Function4;)Lkotlin/jvm/functions/Function4;
|
public static final fun BehaviourContextAndTwoTypesReceiver (Lkotlin/jvm/functions/Function4;)Lkotlin/jvm/functions/Function4;
|
||||||
public static final fun BehaviourContextAndTypeReceiver (Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function3;
|
public static final fun BehaviourContextAndTypeReceiver (Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function3;
|
||||||
public static final fun BehaviourContextReceiver (Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
|
public static final fun BehaviourContextReceiver (Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
|
||||||
public static final fun CustomBehaviourContextAndTypeReceiver (Lkotlin/jvm/functions/Function3;)Lkotlin/jvm/functions/Function3;
|
|
||||||
public static final fun CustomBehaviourContextReceiver (Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
|
public static final fun CustomBehaviourContextReceiver (Lkotlin/jvm/functions/Function2;)Lkotlin/jvm/functions/Function2;
|
||||||
public static final fun createSubContext (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;
|
public static final fun createSubContext (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;
|
||||||
public static synthetic fun createSubContext$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;
|
public static synthetic fun createSubContext$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;
|
||||||
@@ -115,8 +110,8 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/CombinedSubcon
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext : dev/inmo/tgbotapi/updateshandlers/AbstractFlowsUpdatesFilter, dev/inmo/tgbotapi/bot/RequestsExecutor, dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext, kotlinx/coroutines/CoroutineScope {
|
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext : dev/inmo/tgbotapi/updateshandlers/AbstractFlowsUpdatesFilter, dev/inmo/tgbotapi/bot/RequestsExecutor, dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext, kotlinx/coroutines/CoroutineScope {
|
||||||
public fun <init> (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData;Lkotlin/jvm/functions/Function3;)V
|
public fun <init> (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)V
|
||||||
public synthetic fun <init> (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData;Lkotlin/jvm/functions/Function3;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
public synthetic fun <init> (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
|
||||||
public fun close ()V
|
public fun close ()V
|
||||||
public synthetic fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;
|
public synthetic fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;
|
||||||
public fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
|
public fun copy (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Lkotlinx/coroutines/CoroutineScope;ILkotlinx/coroutines/channels/BufferOverflow;Lkotlinx/coroutines/flow/Flow;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlin/jvm/functions/Function3;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/DefaultBehaviourContext;
|
||||||
@@ -139,10 +134,10 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/DefaultCorouti
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBotKt {
|
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/TelegramBotKt {
|
||||||
public static final fun telegramBotWithBehaviour (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
public static final fun telegramBotWithBehaviour (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
public static synthetic fun telegramBotWithBehaviour$default (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
public static synthetic fun telegramBotWithBehaviour$default (Ljava/lang/String;Ldev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||||
public static final fun telegramBotWithBehaviourAndLongPolling (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZIZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
public static final fun telegramBotWithBehaviourAndLongPolling (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZIZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
public static synthetic fun telegramBotWithBehaviourAndLongPolling$default (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZIZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
public static synthetic fun telegramBotWithBehaviourAndLongPolling$default (Ljava/lang/String;Lkotlinx/coroutines/CoroutineScope;Ljava/lang/String;Lkotlin/jvm/functions/Function1;Lkotlin/jvm/functions/Function2;ZIZZLjava/lang/Long;Lkotlin/jvm/functions/Function3;Lkotlin/jvm/functions/Function2;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/VariantsKt {
|
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/VariantsKt {
|
||||||
@@ -339,12 +334,12 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
|
|||||||
public static final fun requireCommandAtStart (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow;
|
public static final fun requireCommandAtStart (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow;
|
||||||
public static final fun requireCommandsWithoutParams (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow;
|
public static final fun requireCommandsWithoutParams (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow;
|
||||||
public static final fun requireSingleCommand (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow;
|
public static final fun requireSingleCommand (Lkotlinx/coroutines/flow/Flow;)Lkotlinx/coroutines/flow/Flow;
|
||||||
public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||||
public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||||
public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
public static final fun waitCommandMessage (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||||
public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||||
public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||||
public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
public static synthetic fun waitCommandMessage$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContentKt {
|
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitContentKt {
|
||||||
@@ -490,12 +485,12 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/W
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitDeepLinksKt {
|
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitDeepLinksKt {
|
||||||
public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||||
public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||||
public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
public static final fun waitDeepLinks (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;)Lkotlinx/coroutines/flow/Flow;
|
||||||
public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||||
public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||||
public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;ZLkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
public static synthetic fun waitDeepLinks$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/requests/abstracts/Request;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Lkotlinx/coroutines/flow/Flow;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitDeletedBusinessMessagesKt {
|
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/WaitDeletedBusinessMessagesKt {
|
||||||
@@ -1156,42 +1151,42 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingKt {
|
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingKt {
|
||||||
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||||
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||||
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
public static final fun command (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun command$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||||
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||||
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
public static final fun commandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun commandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||||
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||||
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
public static final fun commandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun commandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||||
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||||
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
public static final fun onCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;ZLkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun onCommand$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||||
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||||
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
public static final fun onCommandWithArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun onCommandWithArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||||
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||||
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
public static final fun onCommandWithNamedArgs (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/BotCommand;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;ZLkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun onCommandWithNamedArgs$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/text/Regex;Lkotlin/text/Regex;Lkotlin/jvm/functions/Function4;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandledKt {
|
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandledKt {
|
||||||
@@ -1592,32 +1587,6 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handl
|
|||||||
public static synthetic fun onShippingQuery$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
public static synthetic fun onShippingQuery$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/SimpleFilter;Lkotlin/jvm/functions/Function4;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/marker_factories/MarkerFactory;Lkotlin/jvm/functions/Function4;Lkotlin/jvm/functions/Function3;ILjava/lang/Object;)Lkotlinx/coroutines/Job;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiver : kotlin/coroutines/jvm/internal/SuspendFunction, kotlin/jvm/functions/Function3 {
|
|
||||||
public static final field BOT_INFO_RECEIVER Ljava/lang/String;
|
|
||||||
public static final field Companion Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiver$Companion;
|
|
||||||
public fun <init> (Lkotlin/jvm/functions/Function3;)V
|
|
||||||
public fun invoke (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/update/abstracts/Update;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
|
||||||
public final fun invoke (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData;)V
|
|
||||||
public synthetic fun invoke (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiver$Companion {
|
|
||||||
}
|
|
||||||
|
|
||||||
public abstract interface class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiver$IReceiver {
|
|
||||||
public abstract fun invoke (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiverKt {
|
|
||||||
public static final fun botInfo (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
|
||||||
public static final fun containsCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
|
||||||
public static final fun containsCommand (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
|
||||||
public static final fun containsCommand (Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
|
||||||
public static final fun containsCommand (Ljava/util/List;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/text/Regex;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
|
||||||
public static final fun optionallyWithDefaultReceiver (Lkotlin/jvm/functions/Function3;ZLdev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData;)Lkotlin/jvm/functions/Function3;
|
|
||||||
public static final fun withDefaultReceiver (Lkotlin/jvm/functions/Function3;Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContextData;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/DefaultCustomBehaviourContextAndTypeReceiver;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/LiveLocationKt {
|
public final class dev/inmo/tgbotapi/extensions/behaviour_builder/utils/LiveLocationKt {
|
||||||
public static final fun followLocation (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/message/abstracts/ContentMessage;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
public static final fun followLocation (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/types/message/abstracts/ContentMessage;Lkotlin/jvm/functions/Function3;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,8 +3,6 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder
|
|||||||
import dev.inmo.micro_utils.coroutines.ContextSafelyExceptionHandler
|
import dev.inmo.micro_utils.coroutines.ContextSafelyExceptionHandler
|
||||||
import dev.inmo.micro_utils.coroutines.ExceptionHandler
|
import dev.inmo.micro_utils.coroutines.ExceptionHandler
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.DefaultCustomBehaviourContextAndTypeReceiver
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.optionallyWithDefaultReceiver
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.longPolling
|
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.longPolling
|
||||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.startGettingOfUpdatesByLongPolling
|
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.startGettingOfUpdatesByLongPolling
|
||||||
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.updateHandlerWithMediaGroupsAdaptation
|
import dev.inmo.tgbotapi.extensions.utils.updates.retrieving.updateHandlerWithMediaGroupsAdaptation
|
||||||
@@ -33,7 +31,6 @@ suspend fun TelegramBot.buildBehaviour(
|
|||||||
scope: CoroutineScope = defaultCoroutineScopeProvider(),
|
scope: CoroutineScope = defaultCoroutineScopeProvider(),
|
||||||
defaultExceptionsHandler: ExceptionHandler<Unit>? = null,
|
defaultExceptionsHandler: ExceptionHandler<Unit>? = null,
|
||||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||||
useDefaultSubcontextInitialAction: Boolean = true,
|
|
||||||
block: BehaviourContextReceiver<Unit>
|
block: BehaviourContextReceiver<Unit>
|
||||||
): BehaviourContext = BehaviourContext(
|
): BehaviourContext = BehaviourContext(
|
||||||
bot = this,
|
bot = this,
|
||||||
@@ -45,7 +42,6 @@ suspend fun TelegramBot.buildBehaviour(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
flowsUpdatesFilter = flowUpdatesFilter,
|
flowsUpdatesFilter = flowUpdatesFilter,
|
||||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
|
||||||
subcontextInitialAction = subcontextInitialAction
|
subcontextInitialAction = subcontextInitialAction
|
||||||
).apply {
|
).apply {
|
||||||
block()
|
block()
|
||||||
@@ -71,14 +67,12 @@ suspend fun TelegramBot.buildBehaviourWithLongPolling(
|
|||||||
autoSkipTimeoutExceptions: Boolean = true,
|
autoSkipTimeoutExceptions: Boolean = true,
|
||||||
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
||||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||||
useDefaultSubcontextInitialAction: Boolean = true,
|
|
||||||
block: BehaviourContextReceiver<Unit>
|
block: BehaviourContextReceiver<Unit>
|
||||||
): Job {
|
): Job {
|
||||||
val behaviourContext = buildBehaviour(
|
val behaviourContext = buildBehaviour(
|
||||||
scope = scope,
|
scope = scope,
|
||||||
defaultExceptionsHandler = defaultExceptionsHandler,
|
defaultExceptionsHandler = defaultExceptionsHandler,
|
||||||
subcontextInitialAction = subcontextInitialAction,
|
subcontextInitialAction = subcontextInitialAction,
|
||||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
|
||||||
block = block
|
block = block
|
||||||
)
|
)
|
||||||
return longPolling(
|
return longPolling(
|
||||||
@@ -87,7 +81,6 @@ suspend fun TelegramBot.buildBehaviourWithLongPolling(
|
|||||||
timeoutSeconds = timeoutSeconds,
|
timeoutSeconds = timeoutSeconds,
|
||||||
autoDisableWebhooks = autoDisableWebhooks,
|
autoDisableWebhooks = autoDisableWebhooks,
|
||||||
autoSkipTimeoutExceptions = autoSkipTimeoutExceptions,
|
autoSkipTimeoutExceptions = autoSkipTimeoutExceptions,
|
||||||
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
|
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis
|
||||||
exceptionsHandler = defaultExceptionsHandler
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder
|
package dev.inmo.tgbotapi.extensions.behaviour_builder
|
||||||
|
|
||||||
|
import dev.inmo.kslog.common.KSLog
|
||||||
import dev.inmo.micro_utils.coroutines.*
|
import dev.inmo.micro_utils.coroutines.*
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.TriggersHolder
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.TriggersHolder
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.optionallyWithDefaultReceiver
|
|
||||||
import dev.inmo.tgbotapi.types.UpdateId
|
import dev.inmo.tgbotapi.types.UpdateId
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
import dev.inmo.tgbotapi.updateshandlers.*
|
import dev.inmo.tgbotapi.updateshandlers.*
|
||||||
@@ -24,7 +24,6 @@ typealias CustomBehaviourContextAndTwoTypesReceiver<BC, T, I1, I2> = suspend BC.
|
|||||||
typealias BehaviourContextAndTwoTypesReceiver<T, I1, I2> = CustomBehaviourContextAndTwoTypesReceiver<BehaviourContext, T, I1, I2>
|
typealias BehaviourContextAndTwoTypesReceiver<T, I1, I2> = CustomBehaviourContextAndTwoTypesReceiver<BehaviourContext, T, I1, I2>
|
||||||
inline fun <T> BehaviourContextReceiver(noinline block: BehaviourContextReceiver<T>) = block
|
inline fun <T> BehaviourContextReceiver(noinline block: BehaviourContextReceiver<T>) = block
|
||||||
inline fun <BC, T> CustomBehaviourContextReceiver(noinline block: CustomBehaviourContextReceiver<BC, T>) = block
|
inline fun <BC, T> CustomBehaviourContextReceiver(noinline block: CustomBehaviourContextReceiver<BC, T>) = block
|
||||||
inline fun <BC, T, I> CustomBehaviourContextAndTypeReceiver(noinline block: CustomBehaviourContextAndTypeReceiver<BC, T, I>) = block
|
|
||||||
inline fun <T, I> BehaviourContextAndTypeReceiver(noinline block: BehaviourContextAndTypeReceiver<T, I>) = block
|
inline fun <T, I> BehaviourContextAndTypeReceiver(noinline block: BehaviourContextAndTypeReceiver<T, I>) = block
|
||||||
inline fun <T, I1, I2> BehaviourContextAndTwoTypesReceiver(noinline block: BehaviourContextAndTwoTypesReceiver<T, I1, I2>) = block
|
inline fun <T, I1, I2> BehaviourContextAndTwoTypesReceiver(noinline block: BehaviourContextAndTwoTypesReceiver<T, I1, I2>) = block
|
||||||
internal inline fun <BC, T, I1, I2> CustomBehaviourContextAndTwoTypesReceiver<BC, T, I1, I2>.toOneType(
|
internal inline fun <BC, T, I1, I2> CustomBehaviourContextAndTwoTypesReceiver<BC, T, I1, I2>.toOneType(
|
||||||
@@ -83,7 +82,6 @@ class DefaultBehaviourContext(
|
|||||||
onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND,
|
onBufferOverflow: BufferOverflow = BufferOverflow.SUSPEND,
|
||||||
private val upstreamUpdatesFlow: Flow<Update>? = null,
|
private val upstreamUpdatesFlow: Flow<Update>? = null,
|
||||||
override val triggersHolder: TriggersHolder = TriggersHolder(),
|
override val triggersHolder: TriggersHolder = TriggersHolder(),
|
||||||
override val data: BehaviourContextData = BehaviourContextData(),
|
|
||||||
override val subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}
|
override val subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}
|
||||||
) : AbstractFlowsUpdatesFilter(), TelegramBot by bot, CoroutineScope by scope, BehaviourContext {
|
) : AbstractFlowsUpdatesFilter(), TelegramBot by bot, CoroutineScope by scope, BehaviourContext {
|
||||||
|
|
||||||
@@ -108,6 +106,8 @@ class DefaultBehaviourContext(
|
|||||||
}.accumulatorFlow(WeakScope(scope))
|
}.accumulatorFlow(WeakScope(scope))
|
||||||
override val asUpdateReceiver: UpdateReceiver<Update> = additionalUpdatesSharedFlow::emit
|
override val asUpdateReceiver: UpdateReceiver<Update> = additionalUpdatesSharedFlow::emit
|
||||||
|
|
||||||
|
override val data: BehaviourContextData = BehaviourContextData()
|
||||||
|
|
||||||
override fun copy(
|
override fun copy(
|
||||||
bot: TelegramBot,
|
bot: TelegramBot,
|
||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
@@ -123,7 +123,6 @@ class DefaultBehaviourContext(
|
|||||||
onBufferOverflow = onBufferOverflow,
|
onBufferOverflow = onBufferOverflow,
|
||||||
upstreamUpdatesFlow = upstreamUpdatesFlow,
|
upstreamUpdatesFlow = upstreamUpdatesFlow,
|
||||||
triggersHolder = triggersHolder,
|
triggersHolder = triggersHolder,
|
||||||
data = BehaviourContextData().apply { include(this@DefaultBehaviourContext.data) },
|
|
||||||
subcontextInitialAction = subcontextInitialAction
|
subcontextInitialAction = subcontextInitialAction
|
||||||
).apply {
|
).apply {
|
||||||
data.include(this@DefaultBehaviourContext.data)
|
data.include(this@DefaultBehaviourContext.data)
|
||||||
@@ -135,19 +134,8 @@ fun BehaviourContext(
|
|||||||
scope: CoroutineScope,
|
scope: CoroutineScope,
|
||||||
flowsUpdatesFilter: FlowsUpdatesFilter = FlowsUpdatesFilter(),
|
flowsUpdatesFilter: FlowsUpdatesFilter = FlowsUpdatesFilter(),
|
||||||
triggersHolder: TriggersHolder = TriggersHolder(),
|
triggersHolder: TriggersHolder = TriggersHolder(),
|
||||||
useDefaultSubcontextInitialAction: Boolean = true,
|
|
||||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}
|
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {}
|
||||||
): DefaultBehaviourContext {
|
) = DefaultBehaviourContext(bot, scope, upstreamUpdatesFlow = flowsUpdatesFilter.allUpdatesFlow, triggersHolder = triggersHolder, subcontextInitialAction = subcontextInitialAction)
|
||||||
val data = BehaviourContextData()
|
|
||||||
return DefaultBehaviourContext(
|
|
||||||
bot = bot,
|
|
||||||
scope = scope,
|
|
||||||
upstreamUpdatesFlow = flowsUpdatesFilter.allUpdatesFlow,
|
|
||||||
triggersHolder = triggersHolder,
|
|
||||||
data = data,
|
|
||||||
subcontextInitialAction = subcontextInitialAction.optionallyWithDefaultReceiver(useDefaultSubcontextInitialAction, data)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
inline fun <T> BehaviourContext(
|
inline fun <T> BehaviourContext(
|
||||||
bot: TelegramBot,
|
bot: TelegramBot,
|
||||||
@@ -155,58 +143,8 @@ inline fun <T> BehaviourContext(
|
|||||||
flowsUpdatesFilter: FlowsUpdatesFilter = FlowsUpdatesFilter(),
|
flowsUpdatesFilter: FlowsUpdatesFilter = FlowsUpdatesFilter(),
|
||||||
triggersHolder: TriggersHolder = TriggersHolder(),
|
triggersHolder: TriggersHolder = TriggersHolder(),
|
||||||
noinline subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
noinline subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||||
useDefaultSubcontextInitialAction: Boolean = true,
|
|
||||||
crossinline block: BehaviourContext.() -> T
|
crossinline block: BehaviourContext.() -> T
|
||||||
): T {
|
) = DefaultBehaviourContext(bot, scope, upstreamUpdatesFlow = flowsUpdatesFilter.allUpdatesFlow, triggersHolder = triggersHolder, subcontextInitialAction = subcontextInitialAction).run(block)
|
||||||
val data = BehaviourContextData()
|
|
||||||
return DefaultBehaviourContext(
|
|
||||||
bot = bot,
|
|
||||||
scope = scope,
|
|
||||||
upstreamUpdatesFlow = flowsUpdatesFilter.allUpdatesFlow,
|
|
||||||
triggersHolder = triggersHolder,
|
|
||||||
data = data,
|
|
||||||
subcontextInitialAction = subcontextInitialAction.optionallyWithDefaultReceiver(useDefaultSubcontextInitialAction, data)
|
|
||||||
).run(block)
|
|
||||||
}
|
|
||||||
|
|
||||||
inline fun <T> BehaviourContext(
|
|
||||||
bot: TelegramBot,
|
|
||||||
scope: CoroutineScope,
|
|
||||||
upstreamUpdatesFlow: Flow<Update>,
|
|
||||||
triggersHolder: TriggersHolder = TriggersHolder(),
|
|
||||||
noinline subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
|
||||||
useDefaultSubcontextInitialAction: Boolean = true,
|
|
||||||
crossinline block: BehaviourContext.() -> T
|
|
||||||
): T {
|
|
||||||
val data = BehaviourContextData()
|
|
||||||
return DefaultBehaviourContext(
|
|
||||||
bot = bot,
|
|
||||||
scope = scope,
|
|
||||||
upstreamUpdatesFlow = upstreamUpdatesFlow,
|
|
||||||
triggersHolder = triggersHolder,
|
|
||||||
data = data,
|
|
||||||
subcontextInitialAction = subcontextInitialAction.optionallyWithDefaultReceiver(useDefaultSubcontextInitialAction, data)
|
|
||||||
).run(block)
|
|
||||||
}
|
|
||||||
|
|
||||||
fun BehaviourContext(
|
|
||||||
bot: TelegramBot,
|
|
||||||
scope: CoroutineScope,
|
|
||||||
upstreamUpdatesFlow: Flow<Update>,
|
|
||||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update>,
|
|
||||||
triggersHolder: TriggersHolder = TriggersHolder(),
|
|
||||||
useDefaultSubcontextInitialAction: Boolean = true
|
|
||||||
): DefaultBehaviourContext {
|
|
||||||
val data = BehaviourContextData()
|
|
||||||
return DefaultBehaviourContext(
|
|
||||||
bot = bot,
|
|
||||||
scope = scope,
|
|
||||||
upstreamUpdatesFlow = upstreamUpdatesFlow,
|
|
||||||
triggersHolder = triggersHolder,
|
|
||||||
data = data,
|
|
||||||
subcontextInitialAction = subcontextInitialAction.optionallyWithDefaultReceiver(useDefaultSubcontextInitialAction, data)
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates new [BehaviourContext] using its [BehaviourContext.copy] method
|
* Creates new [BehaviourContext] using its [BehaviourContext.copy] method
|
||||||
@@ -229,7 +167,7 @@ fun <BC : BehaviourContext> BC.createSubContext(
|
|||||||
) as BC
|
) as BC
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [CoroutineContext]
|
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext]
|
||||||
*
|
*
|
||||||
* [this] [BehaviourContext] will **NOT** be closed automatically
|
* [this] [BehaviourContext] will **NOT** be closed automatically
|
||||||
*/
|
*/
|
||||||
@@ -242,7 +180,7 @@ suspend fun <T, BC : BehaviourContext> BC.doInContext(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [CoroutineContext]
|
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext]
|
||||||
*
|
*
|
||||||
* [this] [BehaviourContext] will **NOT** be closed automatically
|
* [this] [BehaviourContext] will **NOT** be closed automatically
|
||||||
*/
|
*/
|
||||||
@@ -264,7 +202,7 @@ suspend fun <T, BC : BehaviourContext> BC.doInNewSubContext(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [CoroutineContext]
|
* Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext]
|
||||||
*
|
*
|
||||||
* [this] [BehaviourContext] will **NOT** be closed automatically
|
* [this] [BehaviourContext] will **NOT** be closed automatically
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ suspend fun telegramBotWithBehaviour(
|
|||||||
testServer: Boolean = false,
|
testServer: Boolean = false,
|
||||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||||
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
|
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
|
||||||
useDefaultSubcontextInitialAction: Boolean = true,
|
|
||||||
block: BehaviourContextReceiver<Unit>
|
block: BehaviourContextReceiver<Unit>
|
||||||
): TelegramBot = telegramBot(
|
): TelegramBot = telegramBot(
|
||||||
token,
|
token,
|
||||||
@@ -53,7 +52,6 @@ suspend fun telegramBotWithBehaviour(
|
|||||||
scope = scope ?: CoroutineScope(coroutineContext),
|
scope = scope ?: CoroutineScope(coroutineContext),
|
||||||
defaultExceptionsHandler = defaultExceptionsHandler,
|
defaultExceptionsHandler = defaultExceptionsHandler,
|
||||||
subcontextInitialAction = subcontextInitialAction,
|
subcontextInitialAction = subcontextInitialAction,
|
||||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
|
||||||
block = block
|
block = block
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -88,7 +86,6 @@ suspend fun telegramBotWithBehaviourAndLongPolling(
|
|||||||
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
mediaGroupsDebounceTimeMillis: Long? = 1000L,
|
||||||
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
subcontextInitialAction: CustomBehaviourContextAndTypeReceiver<BehaviourContext, Unit, Update> = {},
|
||||||
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
|
fileLinkUrlMapper: TelegramAPIUrlsKeeper.(String) -> String = { "${fileBaseUrl}/$it" },
|
||||||
useDefaultSubcontextInitialAction: Boolean = true,
|
|
||||||
block: BehaviourContextReceiver<Unit>
|
block: BehaviourContextReceiver<Unit>
|
||||||
): Pair<TelegramBot, Job> {
|
): Pair<TelegramBot, Job> {
|
||||||
return telegramBot(
|
return telegramBot(
|
||||||
@@ -106,7 +103,6 @@ suspend fun telegramBotWithBehaviourAndLongPolling(
|
|||||||
autoSkipTimeoutExceptions = autoSkipTimeoutExceptions,
|
autoSkipTimeoutExceptions = autoSkipTimeoutExceptions,
|
||||||
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
|
mediaGroupsDebounceTimeMillis = mediaGroupsDebounceTimeMillis,
|
||||||
subcontextInitialAction = subcontextInitialAction,
|
subcontextInitialAction = subcontextInitialAction,
|
||||||
useDefaultSubcontextInitialAction = useDefaultSubcontextInitialAction,
|
|
||||||
block = block
|
block = block
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.expectations
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.containsCommand
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.doWithRegistration
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.handlers_registrar.doWithRegistration
|
||||||
import dev.inmo.tgbotapi.extensions.utils.*
|
import dev.inmo.tgbotapi.extensions.utils.*
|
||||||
import dev.inmo.tgbotapi.extensions.utils.extensions.TelegramBotCommandsDefaults
|
import dev.inmo.tgbotapi.extensions.utils.extensions.TelegramBotCommandsDefaults
|
||||||
@@ -28,7 +27,6 @@ import kotlinx.coroutines.flow.*
|
|||||||
fun BehaviourContext.waitCommandMessage(
|
fun BehaviourContext.waitCommandMessage(
|
||||||
commandRegex: Regex,
|
commandRegex: Regex,
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = channelFlow {
|
) = channelFlow {
|
||||||
triggersHolder.handleableCommandsHolder.doWithRegistration(
|
triggersHolder.handleableCommandsHolder.doWithRegistration(
|
||||||
@@ -36,16 +34,6 @@ fun BehaviourContext.waitCommandMessage(
|
|||||||
) {
|
) {
|
||||||
waitTextMessage(initRequest, errorFactory).filter {
|
waitTextMessage(initRequest, errorFactory).filter {
|
||||||
it.content.textSources.any { it.botCommandTextSourceOrNull() ?.command ?.matches(commandRegex) == true }
|
it.content.textSources.any { it.botCommandTextSourceOrNull() ?.command ?.matches(commandRegex) == true }
|
||||||
}.let {
|
|
||||||
if (excludeCommandsToOtherBots) {
|
|
||||||
it.filter {
|
|
||||||
with(it.content.textSources) {
|
|
||||||
containsCommand(commandRegex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
it
|
|
||||||
}
|
|
||||||
}.collect {
|
}.collect {
|
||||||
send(it)
|
send(it)
|
||||||
}
|
}
|
||||||
@@ -55,16 +43,14 @@ fun BehaviourContext.waitCommandMessage(
|
|||||||
fun BehaviourContext.waitCommandMessage(
|
fun BehaviourContext.waitCommandMessage(
|
||||||
command: String,
|
command: String,
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitCommandMessage(Regex(command), initRequest, excludeCommandsToOtherBots, errorFactory)
|
) = waitCommandMessage(Regex(command), initRequest, errorFactory)
|
||||||
|
|
||||||
fun BehaviourContext.waitCommandMessage(
|
fun BehaviourContext.waitCommandMessage(
|
||||||
botCommand: BotCommand,
|
botCommand: BotCommand,
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null }
|
errorFactory: NullableRequestBuilder<*> = { null }
|
||||||
) = waitCommandMessage(botCommand.command, initRequest, excludeCommandsToOtherBots, errorFactory)
|
) = waitCommandMessage(botCommand.command, initRequest, errorFactory)
|
||||||
|
|
||||||
fun Flow<CommonMessage<TextContent>>.requireCommandAtStart() = filter {
|
fun Flow<CommonMessage<TextContent>>.requireCommandAtStart() = filter {
|
||||||
it.content.textSources.firstOrNull() is BotCommandTextSource
|
it.content.textSources.firstOrNull() is BotCommandTextSource
|
||||||
|
|||||||
@@ -10,13 +10,11 @@ import kotlinx.coroutines.flow.*
|
|||||||
|
|
||||||
fun BehaviourContext.waitDeepLinks(
|
fun BehaviourContext.waitDeepLinks(
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
): Flow<Pair<CommonMessage<TextContent>, String>> = waitCommandMessage(
|
): Flow<Pair<CommonMessage<TextContent>, String>> = waitCommandMessage(
|
||||||
command = "start",
|
"start",
|
||||||
initRequest = initRequest,
|
initRequest,
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
errorFactory
|
||||||
errorFactory = errorFactory
|
|
||||||
)
|
)
|
||||||
.requireSingleCommand()
|
.requireSingleCommand()
|
||||||
.requireCommandAtStart()
|
.requireCommandAtStart()
|
||||||
@@ -27,24 +25,13 @@ fun BehaviourContext.waitDeepLinks(
|
|||||||
fun BehaviourContext.waitDeepLinks(
|
fun BehaviourContext.waitDeepLinks(
|
||||||
regex: Regex,
|
regex: Regex,
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
): Flow<Pair<CommonMessage<TextContent>, String>> = waitDeepLinks(
|
): Flow<Pair<CommonMessage<TextContent>, String>> = waitDeepLinks(initRequest, errorFactory).filter {
|
||||||
initRequest = initRequest,
|
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
errorFactory = errorFactory
|
|
||||||
).filter {
|
|
||||||
regex.matches(it.second)
|
regex.matches(it.second)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun BehaviourContext.waitDeepLinks(
|
fun BehaviourContext.waitDeepLinks(
|
||||||
deepLink: String,
|
deepLink: String,
|
||||||
initRequest: Request<*>? = null,
|
initRequest: Request<*>? = null,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
errorFactory: NullableRequestBuilder<*> = { null },
|
errorFactory: NullableRequestBuilder<*> = { null },
|
||||||
): Flow<Pair<CommonMessage<TextContent>, String>> = waitDeepLinks(
|
): Flow<Pair<CommonMessage<TextContent>, String>> = waitDeepLinks(Regex("^$deepLink$"), initRequest, errorFactory)
|
||||||
regex = Regex(pattern = "^$deepLink$"),
|
|
||||||
initRequest = initRequest,
|
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
errorFactory = errorFactory
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
|||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.CommonMessageFilterExcludeMediaGroups
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.CommonMessageFilterExcludeMediaGroups
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByChat
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.MessageFilterByChat
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.botInfo
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.containsCommand
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByChatMessageMarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
|
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times
|
||||||
@@ -17,7 +15,6 @@ import dev.inmo.tgbotapi.extensions.utils.extensions.parseCommandsWithNamedArgs
|
|||||||
import dev.inmo.tgbotapi.types.BotCommand
|
import dev.inmo.tgbotapi.types.BotCommand
|
||||||
import dev.inmo.tgbotapi.types.message.content.TextContent
|
import dev.inmo.tgbotapi.types.message.content.TextContent
|
||||||
import dev.inmo.tgbotapi.types.message.content.TextMessage
|
import dev.inmo.tgbotapi.types.message.content.TextMessage
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.BotCommandTextSource
|
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
||||||
import dev.inmo.tgbotapi.utils.launchWithBotLogger
|
import dev.inmo.tgbotapi.utils.launchWithBotLogger
|
||||||
import kotlinx.coroutines.Job
|
import kotlinx.coroutines.Job
|
||||||
@@ -30,7 +27,6 @@ internal fun <BC : BehaviourContext> BC.commandUncounted(
|
|||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
): Job = onText(
|
): Job = onText(
|
||||||
CommonMessageFilter<TextContent> { message ->
|
CommonMessageFilter<TextContent> { message ->
|
||||||
@@ -44,16 +40,6 @@ internal fun <BC : BehaviourContext> BC.commandUncounted(
|
|||||||
sizeRequirement && textSources.any {
|
sizeRequirement && textSources.any {
|
||||||
commandRegex.matches(it.botCommandTextSourceOrNull() ?.command ?: return@any false)
|
commandRegex.matches(it.botCommandTextSourceOrNull() ?.command ?: return@any false)
|
||||||
}
|
}
|
||||||
}.let {
|
|
||||||
if (excludeCommandsToOtherBots) {
|
|
||||||
it * lambda@{
|
|
||||||
with(it.content.textSources) {
|
|
||||||
containsCommand(commandRegex)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
it
|
|
||||||
}
|
|
||||||
}.let {
|
}.let {
|
||||||
initialFilter ?.times(it) ?: it
|
initialFilter ?.times(it) ?: it
|
||||||
},
|
},
|
||||||
@@ -70,19 +56,17 @@ fun <BC : BehaviourContext> BC.command(
|
|||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
): Job = launchInNewSubContext {
|
): Job = launchInNewSubContext {
|
||||||
runCatching {
|
runCatching {
|
||||||
this@launchInNewSubContext.commandUncounted(
|
this@launchInNewSubContext.commandUncounted(
|
||||||
commandRegex = commandRegex,
|
commandRegex,
|
||||||
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
|
requireOnlyCommandInMessage,
|
||||||
initialFilter = initialFilter,
|
initialFilter,
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
subcontextUpdatesFilter,
|
||||||
markerFactory = markerFactory,
|
markerFactory,
|
||||||
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
|
additionalSubcontextInitialAction,
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
scenarioReceiver
|
||||||
scenarioReceiver = scenarioReceiver
|
|
||||||
)
|
)
|
||||||
}.onFailure {
|
}.onFailure {
|
||||||
triggersHolder.handleableCommandsHolder.unregisterHandleable(commandRegex)
|
triggersHolder.handleableCommandsHolder.unregisterHandleable(commandRegex)
|
||||||
@@ -110,18 +94,8 @@ fun <BC : BehaviourContext> BC.command(
|
|||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
) = command(
|
) = command(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
|
||||||
commandRegex = command.toRegex(),
|
|
||||||
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
|
|
||||||
initialFilter = initialFilter,
|
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
|
||||||
markerFactory = markerFactory,
|
|
||||||
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
|
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
@@ -135,18 +109,8 @@ fun <BC : BehaviourContext> BC.command(
|
|||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
) = command(
|
) = command(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
|
||||||
command = botCommand.command,
|
|
||||||
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
|
|
||||||
initialFilter = initialFilter,
|
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
|
||||||
markerFactory = markerFactory,
|
|
||||||
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
|
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
@@ -160,18 +124,8 @@ fun <BC : BehaviourContext> BC.onCommand(
|
|||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
): Job = command(
|
): Job = command(commandRegex, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
|
||||||
commandRegex = commandRegex,
|
|
||||||
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
|
|
||||||
initialFilter = initialFilter,
|
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
|
||||||
markerFactory = markerFactory,
|
|
||||||
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
|
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
@@ -185,18 +139,8 @@ fun <BC : BehaviourContext> BC.onCommand(
|
|||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
): Job = onCommand(
|
): Job = onCommand(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
|
||||||
commandRegex = command.toRegex(),
|
|
||||||
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
|
|
||||||
initialFilter = initialFilter,
|
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
|
||||||
markerFactory = markerFactory,
|
|
||||||
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
|
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
@@ -210,18 +154,8 @@ fun <BC : BehaviourContext> BC.onCommand(
|
|||||||
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver<BC, Boolean, TextMessage, Update>? = MessageFilterByChat,
|
||||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, TextMessage>
|
||||||
): Job = onCommand(
|
): Job = onCommand(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, additionalSubcontextInitialAction, scenarioReceiver)
|
||||||
command = botCommand.command,
|
|
||||||
requireOnlyCommandInMessage = requireOnlyCommandInMessage,
|
|
||||||
initialFilter = initialFilter,
|
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
|
||||||
markerFactory = markerFactory,
|
|
||||||
additionalSubcontextInitialAction = additionalSubcontextInitialAction,
|
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
|
||||||
)
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
* @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream".
|
||||||
@@ -235,15 +169,13 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
|
|||||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
) = command(
|
) = command(
|
||||||
commandRegex,
|
commandRegex,
|
||||||
requireOnlyCommandInMessage = false,
|
requireOnlyCommandInMessage = false,
|
||||||
initialFilter = initialFilter,
|
initialFilter = initialFilter,
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||||
markerFactory = markerFactory,
|
markerFactory = markerFactory
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
) {
|
) {
|
||||||
val args = it.parseCommandsWithArgs(argsSeparator = argsSeparator).let { commandsWithArgs ->
|
val args = it.parseCommandsWithArgs(argsSeparator = argsSeparator).let { commandsWithArgs ->
|
||||||
val key = commandsWithArgs.keys.firstOrNull { it.matches(commandRegex) } ?: return@let null
|
val key = commandsWithArgs.keys.firstOrNull { it.matches(commandRegex) } ?: return@let null
|
||||||
@@ -264,7 +196,6 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
|
|||||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
) = commandWithArgs(
|
) = commandWithArgs(
|
||||||
command.toRegex(),
|
command.toRegex(),
|
||||||
@@ -272,7 +203,6 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
|
|||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||||
markerFactory = markerFactory,
|
markerFactory = markerFactory,
|
||||||
argsSeparator = argsSeparator,
|
argsSeparator = argsSeparator,
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -288,7 +218,6 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
|
|||||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
) = commandWithArgs(
|
) = commandWithArgs(
|
||||||
botCommand.command,
|
botCommand.command,
|
||||||
@@ -296,7 +225,6 @@ fun <BC : BehaviourContext> BC.commandWithArgs(
|
|||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||||
markerFactory = markerFactory,
|
markerFactory = markerFactory,
|
||||||
argsSeparator = argsSeparator,
|
argsSeparator = argsSeparator,
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -313,14 +241,12 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
|||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||||
) = command(
|
) = command(
|
||||||
commandRegex,
|
commandRegex,
|
||||||
requireOnlyCommandInMessage = false,
|
requireOnlyCommandInMessage = false,
|
||||||
initialFilter = initialFilter,
|
initialFilter = initialFilter,
|
||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
markerFactory = markerFactory
|
markerFactory = markerFactory
|
||||||
) {
|
) {
|
||||||
val args = it.parseCommandsWithNamedArgs(argsSeparator = argsSeparator, nameArgSeparator = nameArgSeparator).let { commandsWithArgs ->
|
val args = it.parseCommandsWithNamedArgs(argsSeparator = argsSeparator, nameArgSeparator = nameArgSeparator).let { commandsWithArgs ->
|
||||||
@@ -343,7 +269,6 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
|||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||||
) = commandWithNamedArgs(
|
) = commandWithNamedArgs(
|
||||||
command.toRegex(),
|
command.toRegex(),
|
||||||
@@ -352,7 +277,6 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
|||||||
markerFactory = markerFactory,
|
markerFactory = markerFactory,
|
||||||
argsSeparator = argsSeparator,
|
argsSeparator = argsSeparator,
|
||||||
nameArgSeparator = nameArgSeparator,
|
nameArgSeparator = nameArgSeparator,
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -369,7 +293,6 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
|||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||||
) = commandWithNamedArgs(
|
) = commandWithNamedArgs(
|
||||||
botCommand.command,
|
botCommand.command,
|
||||||
@@ -378,7 +301,6 @@ fun <BC : BehaviourContext> BC.commandWithNamedArgs(
|
|||||||
markerFactory = markerFactory,
|
markerFactory = markerFactory,
|
||||||
argsSeparator = argsSeparator,
|
argsSeparator = argsSeparator,
|
||||||
nameArgSeparator = nameArgSeparator,
|
nameArgSeparator = nameArgSeparator,
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -394,7 +316,6 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
|||||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
): Job = commandWithArgs(
|
): Job = commandWithArgs(
|
||||||
commandRegex = commandRegex,
|
commandRegex = commandRegex,
|
||||||
@@ -402,7 +323,6 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
|||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||||
markerFactory = markerFactory,
|
markerFactory = markerFactory,
|
||||||
argsSeparator = argsSeparator,
|
argsSeparator = argsSeparator,
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -418,7 +338,6 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
|||||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
): Job = onCommandWithArgs(
|
): Job = onCommandWithArgs(
|
||||||
commandRegex = command.toRegex(),
|
commandRegex = command.toRegex(),
|
||||||
@@ -426,7 +345,6 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
|||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||||
markerFactory = markerFactory,
|
markerFactory = markerFactory,
|
||||||
argsSeparator = argsSeparator,
|
argsSeparator = argsSeparator,
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -442,7 +360,6 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
|||||||
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
markerFactory: MarkerFactory<in TextMessage, Any>? = ByChatMessageMarkerFactory,
|
||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, Array<String>>
|
||||||
): Job = onCommandWithArgs(
|
): Job = onCommandWithArgs(
|
||||||
command = botCommand.command,
|
command = botCommand.command,
|
||||||
@@ -450,7 +367,6 @@ fun <BC : BehaviourContext> BC.onCommandWithArgs(
|
|||||||
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
subcontextUpdatesFilter = subcontextUpdatesFilter,
|
||||||
markerFactory = markerFactory,
|
markerFactory = markerFactory,
|
||||||
argsSeparator = argsSeparator,
|
argsSeparator = argsSeparator,
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -467,7 +383,6 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
|||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||||
) = commandWithNamedArgs(
|
) = commandWithNamedArgs(
|
||||||
commandRegex,
|
commandRegex,
|
||||||
@@ -476,7 +391,6 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
|||||||
markerFactory = markerFactory,
|
markerFactory = markerFactory,
|
||||||
argsSeparator = argsSeparator,
|
argsSeparator = argsSeparator,
|
||||||
nameArgSeparator = nameArgSeparator,
|
nameArgSeparator = nameArgSeparator,
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
scenarioReceiver = scenarioReceiver,
|
scenarioReceiver = scenarioReceiver,
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -493,7 +407,6 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
|||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||||
) = onCommandWithNamedArgs(
|
) = onCommandWithNamedArgs(
|
||||||
command.toRegex(),
|
command.toRegex(),
|
||||||
@@ -502,7 +415,6 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
|||||||
markerFactory = markerFactory,
|
markerFactory = markerFactory,
|
||||||
argsSeparator = argsSeparator,
|
argsSeparator = argsSeparator,
|
||||||
nameArgSeparator = nameArgSeparator,
|
nameArgSeparator = nameArgSeparator,
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -519,7 +431,6 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
|||||||
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
additionalSubcontextInitialAction: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, Update, TextMessage>? = null,
|
||||||
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex,
|
||||||
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex,
|
||||||
excludeCommandsToOtherBots: Boolean = true,
|
|
||||||
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver<BC, Unit, TextMessage, List<Pair<String, String>>>
|
||||||
) = onCommandWithNamedArgs(
|
) = onCommandWithNamedArgs(
|
||||||
botCommand.command,
|
botCommand.command,
|
||||||
@@ -528,6 +439,5 @@ fun <BC : BehaviourContext> BC.onCommandWithNamedArgs(
|
|||||||
markerFactory = markerFactory,
|
markerFactory = markerFactory,
|
||||||
argsSeparator = argsSeparator,
|
argsSeparator = argsSeparator,
|
||||||
nameArgSeparator = nameArgSeparator,
|
nameArgSeparator = nameArgSeparator,
|
||||||
excludeCommandsToOtherBots = excludeCommandsToOtherBots,
|
|
||||||
scenarioReceiver = scenarioReceiver
|
scenarioReceiver = scenarioReceiver
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling
|
||||||
|
|
||||||
import dev.inmo.micro_utils.coroutines.MutableRedeliverStateFlow
|
import dev.inmo.micro_utils.coroutines.SpecialMutableStateFlow
|
||||||
import dev.inmo.micro_utils.coroutines.runCatchingLogging
|
import dev.inmo.micro_utils.coroutines.runCatchingLogging
|
||||||
import dev.inmo.micro_utils.coroutines.subscribeAsync
|
import dev.inmo.micro_utils.coroutines.subscribeAsync
|
||||||
import dev.inmo.micro_utils.coroutines.subscribeLoggingDropExceptions
|
import dev.inmo.micro_utils.coroutines.subscribeLoggingDropExceptions
|
||||||
@@ -49,7 +49,7 @@ internal fun <BC : BehaviourContext, T> BC.on(
|
|||||||
}
|
}
|
||||||
val handler: suspend (Pair<Update, T>) -> Unit = subcontextUpdatesFilter ?.let {
|
val handler: suspend (Pair<Update, T>) -> Unit = subcontextUpdatesFilter ?.let {
|
||||||
{ (update, triggerData) ->
|
{ (update, triggerData) ->
|
||||||
val contextStateFlow = MutableRedeliverStateFlow<BC?>(null)
|
val contextStateFlow = SpecialMutableStateFlow<BC?>(null)
|
||||||
createSubContextAndDoSynchronouslyWithUpdatesFilter(
|
createSubContextAndDoSynchronouslyWithUpdatesFilter(
|
||||||
updatesUpstreamFlow = contextStateFlow.flatMapLatest { context ->
|
updatesUpstreamFlow = contextStateFlow.flatMapLatest { context ->
|
||||||
if (context == null) {
|
if (context == null) {
|
||||||
|
|||||||
@@ -1,137 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.behaviour_builder.utils
|
|
||||||
|
|
||||||
import dev.inmo.micro_utils.common.Warning
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContext
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextData
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.CustomBehaviourContextAndTypeReceiver
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.DefaultCustomBehaviourContextAndTypeReceiver.Companion.BOT_INFO_RECEIVER
|
|
||||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.botInfo
|
|
||||||
import dev.inmo.tgbotapi.extensions.utils.botCommandTextSourceOrNull
|
|
||||||
import dev.inmo.tgbotapi.requests.bot.GetMe
|
|
||||||
import dev.inmo.tgbotapi.types.chat.ExtendedBot
|
|
||||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
|
||||||
import dev.inmo.tgbotapi.types.update.abstracts.Update
|
|
||||||
import kotlinx.coroutines.sync.Mutex
|
|
||||||
import kotlinx.coroutines.sync.withLock
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns bot information (result of [GetMe]) associated with this [BehaviourContext], if available.
|
|
||||||
*
|
|
||||||
* The value is lazily computed and cached by [DefaultCustomBehaviourContextAndTypeReceiver] when it is used
|
|
||||||
* to wrap behaviour handlers. If this context was not prepared by that wrapper, the function returns null.
|
|
||||||
*
|
|
||||||
* Thread-safety:
|
|
||||||
* - The underlying retrieval is protected by a mutex to ensure the info is fetched at most once per context.
|
|
||||||
*
|
|
||||||
* @return [ExtendedBot] with bot details, or null if no bot info provider is registered in this context.
|
|
||||||
*/
|
|
||||||
suspend fun BehaviourContext.botInfo(): ExtendedBot? {
|
|
||||||
return (data[BOT_INFO_RECEIVER] as? DefaultCustomBehaviourContextAndTypeReceiver.IReceiver) ?.run {
|
|
||||||
invoke()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.containsCommand(commandRegex: Regex, textSources: TextSourcesList) = textSources.any {
|
|
||||||
val command = it.botCommandTextSourceOrNull() ?.takeIf {
|
|
||||||
commandRegex.matches(it.command)
|
|
||||||
} ?: return@any false
|
|
||||||
if (command.username == null) {
|
|
||||||
return@any true
|
|
||||||
}
|
|
||||||
val botInfo = botInfo()
|
|
||||||
if (botInfo == null || command.username == botInfo.username) {
|
|
||||||
return@any true
|
|
||||||
}
|
|
||||||
false
|
|
||||||
}
|
|
||||||
|
|
||||||
context(textSources: TextSourcesList, bc: BehaviourContext)
|
|
||||||
suspend fun containsCommand(commandRegex: Regex) = bc.containsCommand(commandRegex, textSources)
|
|
||||||
|
|
||||||
context(textSources: TextSourcesList, bc: BehaviourContext)
|
|
||||||
suspend fun containsCommand(command: String) = containsCommand(Regex(command))
|
|
||||||
|
|
||||||
suspend fun BehaviourContext.containsCommand(command: String, textSources: TextSourcesList) = containsCommand(Regex(command), textSources)
|
|
||||||
|
|
||||||
@Warning("It is internal API and can be changed without notes")
|
|
||||||
fun <BC : BehaviourContext, R, U : Update> CustomBehaviourContextAndTypeReceiver<BC, R, U>.withDefaultReceiver(
|
|
||||||
data: BehaviourContextData
|
|
||||||
) = DefaultCustomBehaviourContextAndTypeReceiver(this).also {
|
|
||||||
it(data)
|
|
||||||
}
|
|
||||||
@Warning("It is internal API and can be changed without notes")
|
|
||||||
fun <BC : BehaviourContext, R, U : Update> CustomBehaviourContextAndTypeReceiver<BC, R, U>.optionallyWithDefaultReceiver(
|
|
||||||
include: Boolean,
|
|
||||||
data: BehaviourContextData
|
|
||||||
) = if (include) {
|
|
||||||
withDefaultReceiver(data)
|
|
||||||
} else {
|
|
||||||
this
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Behaviour wrapper that injects a lazily-evaluated, cached provider of bot information into the [BehaviourContext].
|
|
||||||
*
|
|
||||||
* When this wrapper is used, any code executed inside it may call [BehaviourContext.botInfo] to obtain
|
|
||||||
* the current bot's [ExtendedBot] information. The info is fetched via [GetMe] only once and then cached
|
|
||||||
* for subsequent calls, with concurrent access synchronized by a mutex.
|
|
||||||
*
|
|
||||||
* @param BC Type of [BehaviourContext] used in the wrapped logic.
|
|
||||||
* @param R Result type produced by the wrapped receiver.
|
|
||||||
* @param U Type of [Update] handled by the wrapped receiver.
|
|
||||||
* @param wrapperReceiver The original receiver to be invoked after the bot info provider is registered in the context.
|
|
||||||
*/
|
|
||||||
class DefaultCustomBehaviourContextAndTypeReceiver<BC : BehaviourContext, R, U : Update>(
|
|
||||||
private val wrapperReceiver: CustomBehaviourContextAndTypeReceiver<BC, R, U>
|
|
||||||
) : CustomBehaviourContextAndTypeReceiver<BC, R, U> {
|
|
||||||
private var botInfo: ExtendedBot? = null
|
|
||||||
private val mutex = Mutex()
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Lightweight provider of bot information bound to a [BehaviourContext].
|
|
||||||
*
|
|
||||||
* Implementations must return the current [ExtendedBot] instance, computing it if necessary.
|
|
||||||
*/
|
|
||||||
fun interface IReceiver {
|
|
||||||
/**
|
|
||||||
* Get or compute the bot information for the current [BehaviourContext].
|
|
||||||
*
|
|
||||||
* Implementations may cache the value and are free to apply synchronization as needed.
|
|
||||||
*/
|
|
||||||
suspend fun BehaviourContext.invoke(): ExtendedBot
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Internal provider that performs a single, thread-safe retrieval of bot info via [GetMe] and caches it.
|
|
||||||
*/
|
|
||||||
private val internalReceiver: IReceiver = IReceiver {
|
|
||||||
botInfo ?: mutex.withLock {
|
|
||||||
botInfo ?: execute(GetMe).also {
|
|
||||||
botInfo = it
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
operator fun invoke(data: BehaviourContextData) {
|
|
||||||
data[BOT_INFO_RECEIVER] = internalReceiver
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Registers the internal bot info provider in [BehaviourContext.data] and then delegates to [wrapperReceiver].
|
|
||||||
*
|
|
||||||
* The provider is stored under [BOT_INFO_RECEIVER] key, enabling calls to [BehaviourContext.botInfo] within
|
|
||||||
* the wrapped behaviour.
|
|
||||||
*/
|
|
||||||
override suspend fun invoke(p1: BC, p2: U): R {
|
|
||||||
invoke(p1.data)
|
|
||||||
|
|
||||||
return wrapperReceiver(p1, p2)
|
|
||||||
}
|
|
||||||
|
|
||||||
companion object {
|
|
||||||
/**
|
|
||||||
* Key used to store the bot info provider inside [BehaviourContext.data].
|
|
||||||
*/
|
|
||||||
const val BOT_INFO_RECEIVER = "ktgbotapi_bot_info_receiver"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -30671,10 +30671,6 @@ public final class dev/inmo/tgbotapi/utils/ExtractDataAndJsonFromDecoderKt {
|
|||||||
public static final fun decodeDataAndJson (Lkotlinx/serialization/encoding/Decoder;Lkotlinx/serialization/DeserializationStrategy;)Lkotlin/Pair;
|
public static final fun decodeDataAndJson (Lkotlinx/serialization/encoding/Decoder;Lkotlinx/serialization/DeserializationStrategy;)Lkotlin/Pair;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/utils/FirstOfKt {
|
|
||||||
public static final fun firstOf (Lkotlinx/coroutines/CoroutineScope;[Lkotlin/jvm/functions/Function1;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
|
||||||
}
|
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/utils/IntProgress100Serializer : kotlinx/serialization/KSerializer {
|
public final class dev/inmo/tgbotapi/utils/IntProgress100Serializer : kotlinx/serialization/KSerializer {
|
||||||
public static final field INSTANCE Ldev/inmo/tgbotapi/utils/IntProgress100Serializer;
|
public static final field INSTANCE Ldev/inmo/tgbotapi/utils/IntProgress100Serializer;
|
||||||
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ class DefaultKtorRequestsExecutor internal constructor(
|
|||||||
|
|
||||||
when (e) {
|
when (e) {
|
||||||
is ClientRequestException -> {
|
is ClientRequestException -> {
|
||||||
val exceptionResult = runCatchingLogging(logger = Log) {
|
val exceptionResult = runCatching {
|
||||||
val content = e.response.bodyAsText()
|
val content = e.response.bodyAsText()
|
||||||
val responseObject = jsonFormatter.decodeFromString(Response.serializer(), content)
|
val responseObject = jsonFormatter.decodeFromString(Response.serializer(), content)
|
||||||
newRequestException(
|
newRequestException(
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ object DownloadFileRequestCallFactory : KtorCallFactory {
|
|||||||
jsonFormatter: Json,
|
jsonFormatter: Json,
|
||||||
): T? = (request as? DownloadFile)?.let {
|
): T? = (request as? DownloadFile)?.let {
|
||||||
resolveFile(it.filePath) ?.let {
|
resolveFile(it.filePath) ?.let {
|
||||||
@Suppress("UNCHECKED_CAST")
|
|
||||||
return@makeCall it.bytes() as T // Always ByteArray
|
return@makeCall it.bytes() as T // Always ByteArray
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,9 +20,7 @@ data class ForwardMessage(
|
|||||||
val toChatId: ChatIdentifier,
|
val toChatId: ChatIdentifier,
|
||||||
@SerialName(messageIdField)
|
@SerialName(messageIdField)
|
||||||
override val messageId: MessageId,
|
override val messageId: MessageId,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = toChatId.threadId,
|
override val threadId: MessageThreadId? = toChatId.threadId,
|
||||||
@SerialName(videoStartTimestampField)
|
@SerialName(videoStartTimestampField)
|
||||||
override val startTimestamp: Seconds? = null,
|
override val startTimestamp: Seconds? = null,
|
||||||
|
|||||||
@@ -35,9 +35,7 @@ data class ForwardMessages (
|
|||||||
val fromChatId: ChatIdentifier,
|
val fromChatId: ChatIdentifier,
|
||||||
@SerialName(messageIdsField)
|
@SerialName(messageIdsField)
|
||||||
override val messageIds: List<MessageId>,
|
override val messageIds: List<MessageId>,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = toChatId.threadId,
|
override val threadId: MessageThreadId? = toChatId.threadId,
|
||||||
@SerialName(disableNotificationField)
|
@SerialName(disableNotificationField)
|
||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
|
|||||||
@@ -160,9 +160,7 @@ data class CopyMessage internal constructor(
|
|||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
@SerialName(showCaptionAboveMediaField)
|
@SerialName(showCaptionAboveMediaField)
|
||||||
override val showCaptionAboveMedia: Boolean = false,
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = toChatId.threadId,
|
override val threadId: MessageThreadId? = toChatId.threadId,
|
||||||
@SerialName(videoStartTimestampField)
|
@SerialName(videoStartTimestampField)
|
||||||
override val startTimestamp: Seconds? = null,
|
override val startTimestamp: Seconds? = null,
|
||||||
|
|||||||
@@ -40,9 +40,7 @@ data class CopyMessages (
|
|||||||
val fromChatId: ChatIdentifier,
|
val fromChatId: ChatIdentifier,
|
||||||
@SerialName(messageIdsField)
|
@SerialName(messageIdsField)
|
||||||
override val messageIds: List<MessageId>,
|
override val messageIds: List<MessageId>,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = toChatId.threadId,
|
override val threadId: MessageThreadId? = toChatId.threadId,
|
||||||
@SerialName(disableNotificationField)
|
@SerialName(disableNotificationField)
|
||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
|
|||||||
@@ -18,9 +18,7 @@ data class SendAction(
|
|||||||
override val chatId: ChatIdentifier,
|
override val chatId: ChatIdentifier,
|
||||||
@SerialName(actionField)
|
@SerialName(actionField)
|
||||||
val action: BotAction,
|
val action: BotAction,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId
|
||||||
|
|||||||
@@ -24,9 +24,7 @@ data class SendContact(
|
|||||||
val firstName: String,
|
val firstName: String,
|
||||||
@SerialName(lastNameField)
|
@SerialName(lastNameField)
|
||||||
val lastName: String? = null,
|
val lastName: String? = null,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
|||||||
@@ -23,9 +23,7 @@ data class SendDice(
|
|||||||
override val chatId: ChatIdentifier,
|
override val chatId: ChatIdentifier,
|
||||||
@SerialName(emojiField)
|
@SerialName(emojiField)
|
||||||
val animationType: DiceAnimationType? = null,
|
val animationType: DiceAnimationType? = null,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
|||||||
@@ -139,8 +139,8 @@ sealed interface SendLocation<T : LocationContent> : SendContentMessageRequest<C
|
|||||||
override val heading: Degrees? = null,
|
override val heading: Degrees? = null,
|
||||||
@SerialName(proximityAlertRadiusField)
|
@SerialName(proximityAlertRadiusField)
|
||||||
override val proximityAlertRadius: Meters? = null,
|
override val proximityAlertRadius: Meters? = null,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
|
@OptIn(ExperimentalSerializationApi::class)
|
||||||
@EncodeDefault
|
@EncodeDefault
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
|
|||||||
@@ -89,9 +89,7 @@ data class SendTextMessage internal constructor(
|
|||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
@SerialName(entitiesField)
|
@SerialName(entitiesField)
|
||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
|||||||
@@ -33,9 +33,7 @@ data class SendVenue(
|
|||||||
val googlePlaceId: GooglePlaceId? = null,
|
val googlePlaceId: GooglePlaceId? = null,
|
||||||
@SerialName(googlePlaceTypeField)
|
@SerialName(googlePlaceTypeField)
|
||||||
val googlePlaceType: GooglePlaceType? = null,
|
val googlePlaceType: GooglePlaceType? = null,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
|||||||
@@ -20,9 +20,7 @@ data class SendGame (
|
|||||||
override val chatId: ChatIdentifier,
|
override val chatId: ChatIdentifier,
|
||||||
@SerialName(gameShortNameField)
|
@SerialName(gameShortNameField)
|
||||||
val gameShortName: String,
|
val gameShortName: String,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
|||||||
@@ -160,9 +160,7 @@ data class SendAnimationData internal constructor(
|
|||||||
override val width: Int? = null,
|
override val width: Int? = null,
|
||||||
@SerialName(heightField)
|
@SerialName(heightField)
|
||||||
override val height: Int? = null,
|
override val height: Int? = null,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
|||||||
@@ -149,9 +149,7 @@ data class SendAudioData internal constructor(
|
|||||||
override val performer: String? = null,
|
override val performer: String? = null,
|
||||||
@SerialName(titleField)
|
@SerialName(titleField)
|
||||||
override val title: String? = null,
|
override val title: String? = null,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
|||||||
@@ -161,9 +161,7 @@ data class SendDocumentData internal constructor(
|
|||||||
override val parseMode: ParseMode? = null,
|
override val parseMode: ParseMode? = null,
|
||||||
@SerialName(captionEntitiesField)
|
@SerialName(captionEntitiesField)
|
||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
|||||||
@@ -191,9 +191,7 @@ data class SendMediaGroupData internal constructor(
|
|||||||
@SerialName(chatIdField)
|
@SerialName(chatIdField)
|
||||||
override val chatId: ChatIdentifier,
|
override val chatId: ChatIdentifier,
|
||||||
val media: List<MediaGroupMemberTelegramMedia> = emptyList(),
|
val media: List<MediaGroupMemberTelegramMedia> = emptyList(),
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
|||||||
@@ -167,9 +167,7 @@ data class SendPaidMediaData internal constructor(
|
|||||||
val payload: PaidMediaPayload? = null,
|
val payload: PaidMediaPayload? = null,
|
||||||
@SerialName(showCaptionAboveMediaField)
|
@SerialName(showCaptionAboveMediaField)
|
||||||
override val showCaptionAboveMedia: Boolean = false,
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
|||||||
@@ -128,9 +128,7 @@ data class SendPhotoData internal constructor(
|
|||||||
override val showCaptionAboveMedia: Boolean = false,
|
override val showCaptionAboveMedia: Boolean = false,
|
||||||
@SerialName(hasSpoilerField)
|
@SerialName(hasSpoilerField)
|
||||||
override val spoilered: Boolean = false,
|
override val spoilered: Boolean = false,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
|||||||
@@ -58,9 +58,7 @@ data class SendStickerByFileId internal constructor(
|
|||||||
override val chatId: ChatIdentifier,
|
override val chatId: ChatIdentifier,
|
||||||
@SerialName(stickerField)
|
@SerialName(stickerField)
|
||||||
val sticker: InputFile,
|
val sticker: InputFile,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
|||||||
@@ -181,9 +181,7 @@ data class SendVideoData internal constructor(
|
|||||||
override val height: Int? = null,
|
override val height: Int? = null,
|
||||||
@SerialName(supportStreamingField)
|
@SerialName(supportStreamingField)
|
||||||
val supportStreaming: Boolean? = null,
|
val supportStreaming: Boolean? = null,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
|||||||
@@ -74,9 +74,7 @@ data class SendVideoNoteData internal constructor(
|
|||||||
override val duration: Long? = null,
|
override val duration: Long? = null,
|
||||||
@SerialName(lengthField)
|
@SerialName(lengthField)
|
||||||
override val width: Int? = null,
|
override val width: Int? = null,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
|||||||
@@ -126,9 +126,7 @@ data class SendVoiceData internal constructor(
|
|||||||
private val rawEntities: List<RawMessageEntity>? = null,
|
private val rawEntities: List<RawMessageEntity>? = null,
|
||||||
@SerialName(durationField)
|
@SerialName(durationField)
|
||||||
override val duration: Long? = null,
|
override val duration: Long? = null,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ import dev.inmo.tgbotapi.types.payments.LabeledPrice
|
|||||||
import dev.inmo.tgbotapi.types.payments.LabeledPricesSerializer
|
import dev.inmo.tgbotapi.types.payments.LabeledPricesSerializer
|
||||||
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
import dev.inmo.tgbotapi.types.payments.abstracts.Currency
|
||||||
import dev.inmo.tgbotapi.types.payments.abstracts.XTR
|
import dev.inmo.tgbotapi.types.payments.abstracts.XTR
|
||||||
import dev.inmo.tgbotapi.types.threadId
|
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
|
|
||||||
private val invoiceMessageSerializer: DeserializationStrategy<ContentMessage<InvoiceContent>>
|
private val invoiceMessageSerializer: DeserializationStrategy<ContentMessage<InvoiceContent>>
|
||||||
@@ -62,9 +61,7 @@ data class SendInvoice(
|
|||||||
override val shouldSendEmailToProvider: Boolean = false,
|
override val shouldSendEmailToProvider: Boolean = false,
|
||||||
@SerialName(priceDependOnShipAddressField)
|
@SerialName(priceDependOnShipAddressField)
|
||||||
override val priceDependOnShipAddress: Boolean = false,
|
override val priceDependOnShipAddress: Boolean = false,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(disableNotificationField)
|
@SerialName(disableNotificationField)
|
||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ import dev.inmo.tgbotapi.types.polls.ExactScheduledCloseInfo
|
|||||||
import dev.inmo.tgbotapi.types.polls.InputPollOption
|
import dev.inmo.tgbotapi.types.polls.InputPollOption
|
||||||
import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
|
import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
|
||||||
import dev.inmo.tgbotapi.utils.extensions.makeSourceString
|
import dev.inmo.tgbotapi.utils.extensions.makeSourceString
|
||||||
import kotlinx.serialization.EncodeDefault
|
|
||||||
import kotlinx.serialization.ExperimentalSerializationApi
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.SerializationStrategy
|
import kotlinx.serialization.SerializationStrategy
|
||||||
@@ -48,9 +46,7 @@ class SendQuizPoll internal constructor(
|
|||||||
override val openPeriod: LongSeconds? = null,
|
override val openPeriod: LongSeconds? = null,
|
||||||
@SerialName(closeDateField)
|
@SerialName(closeDateField)
|
||||||
override val closeDate: LongSeconds? = null,
|
override val closeDate: LongSeconds? = null,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ import dev.inmo.tgbotapi.types.polls.ScheduledCloseInfo
|
|||||||
import dev.inmo.tgbotapi.utils.EntitiesBuilder
|
import dev.inmo.tgbotapi.utils.EntitiesBuilder
|
||||||
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody
|
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody
|
||||||
import dev.inmo.tgbotapi.utils.extensions.makeSourceString
|
import dev.inmo.tgbotapi.utils.extensions.makeSourceString
|
||||||
import kotlinx.serialization.EncodeDefault
|
|
||||||
import kotlinx.serialization.ExperimentalSerializationApi
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.SerializationStrategy
|
import kotlinx.serialization.SerializationStrategy
|
||||||
@@ -43,9 +41,7 @@ class SendRegularPoll private constructor(
|
|||||||
override val openPeriod: LongSeconds?= null,
|
override val openPeriod: LongSeconds?= null,
|
||||||
@SerialName(closeDateField)
|
@SerialName(closeDateField)
|
||||||
override val closeDate: LongSeconds? = null,
|
override val closeDate: LongSeconds? = null,
|
||||||
@OptIn(ExperimentalSerializationApi::class)
|
|
||||||
@SerialName(messageThreadIdField)
|
@SerialName(messageThreadIdField)
|
||||||
@EncodeDefault
|
|
||||||
override val threadId: MessageThreadId? = chatId.threadId,
|
override val threadId: MessageThreadId? = chatId.threadId,
|
||||||
@SerialName(businessConnectionIdField)
|
@SerialName(businessConnectionIdField)
|
||||||
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||||
|
|||||||
@@ -2,17 +2,6 @@ package dev.inmo.tgbotapi.utils
|
|||||||
|
|
||||||
import kotlinx.coroutines.CancellationException
|
import kotlinx.coroutines.CancellationException
|
||||||
|
|
||||||
/**
|
|
||||||
* Traverses this throwable's cause chain to find a [CancellationException].
|
|
||||||
*
|
|
||||||
* It walks through `this` and its `cause`s until the first [CancellationException] is encountered,
|
|
||||||
* and returns that exception. If no [CancellationException] is found in the chain, returns `null`.
|
|
||||||
*
|
|
||||||
* This is useful when you need to distinguish cancellations from other failures while handling errors.
|
|
||||||
*
|
|
||||||
* @receiver the root [Throwable] to inspect
|
|
||||||
* @return the first [CancellationException] found in the cause chain, or `null` if none present
|
|
||||||
*/
|
|
||||||
fun Throwable.causedCancellationException(): CancellationException? {
|
fun Throwable.causedCancellationException(): CancellationException? {
|
||||||
var current = this
|
var current = this
|
||||||
while (current !is CancellationException) {
|
while (current !is CancellationException) {
|
||||||
@@ -26,10 +15,4 @@ fun Throwable.causedCancellationException(): CancellationException? {
|
|||||||
return current
|
return current
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
fun Throwable.isCausedByCancellation(): Boolean = causedCancellationException() == null
|
||||||
* Checks whether this throwable (or any of its causes) is a [CancellationException].
|
|
||||||
*
|
|
||||||
* @receiver the [Throwable] to inspect
|
|
||||||
* @return `true` if a [CancellationException] is found in the cause chain, `false` otherwise
|
|
||||||
*/
|
|
||||||
fun Throwable.isCausedByCancellation(): Boolean = causedCancellationException() != null
|
|
||||||
|
|||||||
@@ -1,26 +0,0 @@
|
|||||||
package dev.inmo.tgbotapi.utils
|
|
||||||
|
|
||||||
import dev.inmo.micro_utils.coroutines.firstOf
|
|
||||||
import kotlinx.coroutines.CoroutineScope
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Launches all provided suspending [deferreds] in this [CoroutineScope] and returns the value
|
|
||||||
* produced by the first block that completes.
|
|
||||||
*
|
|
||||||
* - Provide at least one block; otherwise the call will never complete.
|
|
||||||
* - Cancellation and error propagation semantics are delegated to the underlying
|
|
||||||
* dev.inmo.micro_utils.coroutines.firstOf implementation.
|
|
||||||
*
|
|
||||||
* @param T The type of the resulting value.
|
|
||||||
* @param deferreds The suspending blocks to race; they are started eagerly.
|
|
||||||
* @return The result produced by the first completed block.
|
|
||||||
*/
|
|
||||||
suspend fun <T> CoroutineScope.firstOf(
|
|
||||||
vararg deferreds: suspend () -> T
|
|
||||||
): T = firstOf {
|
|
||||||
deferreds.forEach {
|
|
||||||
add {
|
|
||||||
it()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user