From 1a8cfefa4def58f069c74f296bcec4b8dc24c295 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 13 Jun 2024 21:09:49 +0600 Subject: [PATCH 01/12] start 14.0.2 --- CHANGELOG.md | 2 ++ gradle.properties | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9aa353a4eb..b63525f89a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # TelegramBotAPI changelog +## 14.0.2 + ## 14.0.1 * In `core` and `api` modules related to invoices changed their APIs to suite current API diff --git a/gradle.properties b/gradle.properties index bf9769c9e5..64f19b9f36 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ kotlin.incremental=true kotlin.incremental.js=true library_group=dev.inmo -library_version=14.0.1 +library_version=14.0.2 From 97836c5f4e4bcc81b21a998a659cfdb621ed7252 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 13 Jun 2024 21:32:04 +0600 Subject: [PATCH 02/12] rewrite createSubContextAndDoWithUpdatesFilter and doInContext to work with supervisor scope --- .../api/tgbotapi.behaviour_builder.api | 7 +++-- .../behaviour_builder/BehaviourContext.kt | 26 +++++++------------ .../triggers_handling/MainTrigger.kt | 4 +-- 3 files changed, 14 insertions(+), 23 deletions(-) diff --git a/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api b/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api index 17d4107dc5..7a5cf4894c 100644 --- a/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api +++ b/tgbotapi.behaviour_builder/api/tgbotapi.behaviour_builder.api @@ -36,10 +36,9 @@ public final class dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourConte 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;)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;ILjava/lang/Object;)Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext; - public static final fun createSubContextAndDoWithUpdatesFilter (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlinx/coroutines/CoroutineScope;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun createSubContextAndDoWithUpdatesFilter$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;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; - public static final fun doInContext (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; - public static synthetic fun doInContext$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;ZLkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun createSubContextAndDoWithUpdatesFilter (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; + public static synthetic fun createSubContextAndDoWithUpdatesFilter$default (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Ldev/inmo/tgbotapi/extensions/behaviour_builder/utils/handlers_registrar/TriggersHolder;Lkotlinx/coroutines/flow/Flow;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object; + public static final fun doInContext (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;Lkotlin/jvm/functions/Function2;Lkotlin/coroutines/Continuation;)Ljava/lang/Object; public static final fun stop (Ldev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext;)V } diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt index 56b3448981..331de9ca6d 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt @@ -132,39 +132,33 @@ fun BC.createSubContext( /** * Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext] - * - * @param stopOnCompletion ___FALSE BY DEFAULT___. Will stop [this] in case if passed true */ suspend fun BC.doInContext( - stopOnCompletion: Boolean = false, behaviourContextReceiver: CustomBehaviourContextReceiver ): T { return withContext(coroutineContext) { - behaviourContextReceiver().also { if (stopOnCompletion) stop() } + behaviourContextReceiver() } } /** * Creates new one [BehaviourContext] using [createSubContext] and launches [behaviourContextReceiver] in a new context * using [doInContext] - * - * @param stopOnCompletion ___TRUE BY DEFAULT___ */ suspend fun BC.createSubContextAndDoWithUpdatesFilter( - scope: CoroutineScope = LinkedSupervisorScope(), triggersHolder: TriggersHolder = this.triggersHolder, updatesUpstreamFlow: Flow = allUpdatesFlow, - stopOnCompletion: Boolean = true, behaviourContextReceiver: CustomBehaviourContextReceiver ): T { - return createSubContext( - scope, - triggersHolder, - updatesUpstreamFlow - ).doInContext( - stopOnCompletion, - behaviourContextReceiver - ) + return supervisorScope { + createSubContext( + scope = this, + triggersHolder = triggersHolder, + updatesUpstreamFlow = updatesUpstreamFlow + ).doInContext( + behaviourContextReceiver = behaviourContextReceiver + ) + } } /** diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MainTrigger.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MainTrigger.kt index 80c386c70c..73819a7fec 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MainTrigger.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MainTrigger.kt @@ -30,9 +30,7 @@ internal suspend inline fun BC.on( scope, { markerFactory(it.second) } ) { (update, triggerData) -> - createSubContextAndDoWithUpdatesFilter( - stopOnCompletion = false - ) { + createSubContextAndDoWithUpdatesFilter { if (subcontextUpdatesFilter ?.invoke(this, triggerData, update) != false) { scenarioReceiver(triggerData) } From 91a8058a3aa2a2b3729ea4ec2a9e6d3b17a99eba Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 13 Jun 2024 22:24:16 +0600 Subject: [PATCH 03/12] try to support nullable marker factory --- .../BusinessConnectionTriggers.kt | 6 +- .../CallbackQueryTriggers.kt | 34 +++---- .../CallbackQueryTriggersUnhandled.kt | 6 +- .../ChatBoostRemovedTriggers.kt | 2 +- .../ChatBoostUpdatedTriggers.kt | 2 +- .../ChatJoinRequestTriggers.kt | 2 +- .../ChatMemberUpdatedTriggers.kt | 8 +- ...sageReactionCountUpdatedUpdatesTriggers.kt | 2 +- ...atMessageReactionUpdatedUpdatesTriggers.kt | 8 +- .../ChosenInlineResultTriggers.kt | 8 +- .../triggers_handling/CommandHandling.kt | 38 ++++---- .../CommandHandlingUnhandled.kt | 8 +- .../triggers_handling/ContentTriggers.kt | 62 ++++++------- .../triggers_handling/DeepLinkHandling.kt | 6 +- .../DeletedBusinessMessagesTriggers.kt | 2 +- .../EditedContentTriggers.kt | 44 +++++----- .../triggers_handling/EventTriggers.kt | 88 +++++++++---------- .../triggers_handling/InlineQueryTriggers.kt | 8 +- .../triggers_handling/MainTrigger.kt | 28 ++++-- .../MediaGroupMessagesTriggers.kt | 16 ++-- .../triggers_handling/MediaGroupTriggers.kt | 16 ++-- .../triggers_handling/MentionTriggers.kt | 72 +++++++-------- .../triggers_handling/PassportTriggers.kt | 4 +- .../triggers_handling/PollAnswersTriggers.kt | 4 +- .../triggers_handling/PollUpdatesTriggers.kt | 8 +- .../PreCheckoutQueryTriggers.kt | 2 +- .../ShippingQueryTriggers.kt | 2 +- 27 files changed, 249 insertions(+), 237 deletions(-) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/BusinessConnectionTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/BusinessConnectionTriggers.kt index 68c0386e46..45e61d0995 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/BusinessConnectionTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/BusinessConnectionTriggers.kt @@ -27,7 +27,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update suspend fun BC.onBusinessConnection( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByUserBusinessConnectionUpdatedMarkerFactory, + markerFactory: MarkerFactory? = ByUserBusinessConnectionUpdatedMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { (it.businessConnectionUpdateOrNull() ?.data) ?.let(::listOfNotNull) @@ -48,7 +48,7 @@ suspend fun BC.onBusinessConnection( suspend fun BC.onBusinessConnectionEnabled( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByUserBusinessConnectionUpdatedMarkerFactory, + markerFactory: MarkerFactory? = ByUserBusinessConnectionUpdatedMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { (it.businessConnectionUpdateOrNull() ?.data ?.enabledOrNull()) ?.let(::listOfNotNull) @@ -68,7 +68,7 @@ suspend fun BC.onBusinessConnectionEnabled( suspend fun BC.onBusinessConnectionDisabled( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByUserBusinessConnectionUpdatedMarkerFactory, + markerFactory: MarkerFactory? = ByUserBusinessConnectionUpdatedMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { (it.businessConnectionUpdateOrNull() ?.data ?.disabledOrNull()) ?.let(::listOfNotNull) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt index c2ca912858..15822ace95 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt @@ -18,7 +18,7 @@ import kotlinx.coroutines.Job internal suspend inline fun BC.onCallbackQuery( initialFilter: SimpleFilter? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { (it.callbackQueryUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull) @@ -39,7 +39,7 @@ internal suspend inline fun B internal suspend inline fun BC.onDataCallbackQueryCounted( initialFilter: SimpleFilter? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver ): Job { val newInitialFilter = SimpleFilter { @@ -81,7 +81,7 @@ internal suspend inline fun BC.onDataCallbackQuery( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onDataCallbackQueryCounted( initialFilter, @@ -108,7 +108,7 @@ suspend fun BC.onDataCallbackQuery( dataRegex: Regex, initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onDataCallbackQuery( initialFilter = initialFilter * { @@ -136,7 +136,7 @@ suspend fun BC.onDataCallbackQuery( data: String, initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onDataCallbackQuery( Regex(data), @@ -161,7 +161,7 @@ suspend fun BC.onDataCallbackQuery( suspend fun BC.onGameShortNameCallbackQuery( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onCallbackQuery( initialFilter, @@ -185,7 +185,7 @@ suspend fun BC.onGameShortNameCallbackQuery( suspend fun BC.onInlineMessageIdCallbackQuery( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onCallbackQuery( initialFilter, @@ -209,7 +209,7 @@ suspend fun BC.onInlineMessageIdCallbackQuery( suspend fun BC.onInlineMessageIdDataCallbackQuery( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onDataCallbackQueryCounted( initialFilter, @@ -236,7 +236,7 @@ suspend fun BC.onInlineMessageIdDataCallbackQuery( dataRegex: Regex, initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onInlineMessageIdDataCallbackQuery( initialFilter = initialFilter * { @@ -264,7 +264,7 @@ suspend fun BC.onInlineMessageIdDataCallbackQuery( data: String, initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onInlineMessageIdDataCallbackQuery( Regex(data), @@ -289,7 +289,7 @@ suspend fun BC.onInlineMessageIdDataCallbackQuery( suspend fun BC.onInlineMessageIdGameShortNameCallbackQuery( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onCallbackQuery( initialFilter, @@ -313,7 +313,7 @@ suspend fun BC.onInlineMessageIdGameShortNameCallbackQue suspend fun BC.onMessageCallbackQuery( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onCallbackQuery( initialFilter, @@ -337,7 +337,7 @@ suspend fun BC.onMessageCallbackQuery( suspend fun BC.onMessageDataCallbackQuery( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onDataCallbackQueryCounted( initialFilter, @@ -364,7 +364,7 @@ suspend fun BC.onMessageDataCallbackQuery( dataRegex: Regex, initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onMessageDataCallbackQuery( initialFilter = initialFilter * { @@ -392,7 +392,7 @@ suspend fun BC.onMessageDataCallbackQuery( data: String, initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onMessageDataCallbackQuery( Regex(data), @@ -417,7 +417,7 @@ suspend fun BC.onMessageDataCallbackQuery( suspend fun BC.onMessageGameShortNameCallbackQuery( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onCallbackQuery( initialFilter, @@ -441,7 +441,7 @@ suspend fun BC.onMessageGameShortNameCallbackQuery( suspend fun BC.onUnknownCallbackQueryType( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onCallbackQuery( initialFilter, diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggersUnhandled.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggersUnhandled.kt index 22f4fd4bdb..8b8d2ad746 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggersUnhandled.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggersUnhandled.kt @@ -27,7 +27,7 @@ import dev.inmo.tgbotapi.utils.PreviewFeature suspend fun BC.onUnhandledDataCallbackQuery( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onCallbackQuery ( initialFilter * !SimpleFilter { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) }, @@ -52,7 +52,7 @@ suspend fun BC.onUnhandledDataCallbackQuery( suspend fun BC.onUnhandledInlineMessageIdDataCallbackQuery( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onCallbackQuery ( initialFilter * !SimpleFilter { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) }, @@ -77,7 +77,7 @@ suspend fun BC.onUnhandledInlineMessageIdDataCallbackQue suspend fun BC.onUnhandledMessageDataCallbackQuery( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = CallbackQueryFilterByUser, - markerFactory: MarkerFactory = ByUserCallbackQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserCallbackQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onCallbackQuery( initialFilter * !SimpleFilter { triggersHolder.handleableCallbackQueriesDataHolder.isHandled(it) }, diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatBoostRemovedTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatBoostRemovedTriggers.kt index 3dae6f99ef..1812aef540 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatBoostRemovedTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatBoostRemovedTriggers.kt @@ -27,7 +27,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update suspend fun BC.onChatBoostRemoved( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByIdChatBoostRemovedMarkerFactory, + markerFactory: MarkerFactory? = ByIdChatBoostRemovedMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { (it.chatBoostRemovedUpdateOrNull() ?.data) ?.let(::listOfNotNull) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatBoostUpdatedTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatBoostUpdatedTriggers.kt index 5e94dab7ce..6695cfceff 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatBoostUpdatedTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatBoostUpdatedTriggers.kt @@ -27,7 +27,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update suspend fun BC.onChatBoostUpdated( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByIdChatBoostUpdatedMarkerFactory, + markerFactory: MarkerFactory? = ByIdChatBoostUpdatedMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { (it.chatBoostUpdatedUpdateOrNull() ?.data) ?.let(::listOfNotNull) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatJoinRequestTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatJoinRequestTriggers.kt index 21cbd37159..523b169545 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatJoinRequestTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatJoinRequestTriggers.kt @@ -25,7 +25,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update suspend fun BC.onChatJoinRequest( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByChatChatJoinRequestMarkerFactory, + markerFactory: MarkerFactory? = ByChatChatJoinRequestMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { (it.chatJoinRequestUpdateOrNull() ?.data) ?.let(::listOfNotNull) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMemberUpdatedTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMemberUpdatedTriggers.kt index bdfec02d1a..1bcd9497bc 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMemberUpdatedTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMemberUpdatedTriggers.kt @@ -17,7 +17,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update internal suspend inline fun BC.onChatMemberUpdatedInternal( initialFilter: SimpleFilter? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = ChatMemberUpdatedFilterByChat, - markerFactory: MarkerFactory = ByChatChatMemberUpdatedMarkerFactory, + markerFactory: MarkerFactory? = ByChatChatMemberUpdatedMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { ((it as? U) ?.data) ?.let(::listOfNotNull) @@ -39,7 +39,7 @@ internal suspend inline fun BC.onChatMemberUpdated( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = ChatMemberUpdatedFilterByChat, - markerFactory: MarkerFactory = ByChatChatMemberUpdatedMarkerFactory, + markerFactory: MarkerFactory? = ByChatChatMemberUpdatedMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onChatMemberUpdatedInternal( initialFilter, @@ -63,7 +63,7 @@ suspend fun BC.onChatMemberUpdated( suspend fun BC.onCommonChatMemberUpdated( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = ChatMemberUpdatedFilterByChat, - markerFactory: MarkerFactory = ByChatChatMemberUpdatedMarkerFactory, + markerFactory: MarkerFactory? = ByChatChatMemberUpdatedMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onChatMemberUpdatedInternal( initialFilter, @@ -87,7 +87,7 @@ suspend fun BC.onCommonChatMemberUpdated( suspend fun BC.onMyChatMemberUpdated( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = ChatMemberUpdatedFilterByChat, - markerFactory: MarkerFactory = ByChatChatMemberUpdatedMarkerFactory, + markerFactory: MarkerFactory? = ByChatChatMemberUpdatedMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onChatMemberUpdatedInternal( initialFilter, diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMessageReactionCountUpdatedUpdatesTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMessageReactionCountUpdatedUpdatesTriggers.kt index 9db5e94a07..e8d2f101c3 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMessageReactionCountUpdatedUpdatesTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMessageReactionCountUpdatedUpdatesTriggers.kt @@ -31,7 +31,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update suspend fun BC.onChatMessageReactionsCountUpdated( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByChatIdChatMessageReactionsCountUpdatedMarkerFactory, + markerFactory: MarkerFactory? = ByChatIdChatMessageReactionsCountUpdatedMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { (it.chatMessageReactionsCountUpdatedUpdateOrNull() ?.data) ?.let(::listOfNotNull) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMessageReactionUpdatedUpdatesTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMessageReactionUpdatedUpdatesTriggers.kt index fcad229211..0afe522f72 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMessageReactionUpdatedUpdatesTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMessageReactionUpdatedUpdatesTriggers.kt @@ -15,7 +15,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update internal suspend inline fun BC.onChatMessageReactionUpdated( initialFilter: SimpleFilter? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByChatIdChatMessageReactionUpdatedMarkerFactory, + markerFactory: MarkerFactory? = ByChatIdChatMessageReactionUpdatedMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { (it.chatMessageReactionUpdatedUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull) @@ -36,7 +36,7 @@ internal suspend inline fun BC.onChatMessageReactionUpdatedByUser( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByChatIdChatMessageReactionUpdatedMarkerFactory, + markerFactory: MarkerFactory? = ByChatIdChatMessageReactionUpdatedMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onChatMessageReactionUpdated( initialFilter, @@ -60,7 +60,7 @@ suspend fun BC.onChatMessageReactionUpdatedByUser( suspend fun BC.onChatMessageReactionUpdatedByChat( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByChatIdChatMessageReactionUpdatedMarkerFactory, + markerFactory: MarkerFactory? = ByChatIdChatMessageReactionUpdatedMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onChatMessageReactionUpdated( initialFilter, @@ -84,7 +84,7 @@ suspend fun BC.onChatMessageReactionUpdatedByChat( suspend fun BC.onChatMessageReactionUpdatedUnknown( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByChatIdChatMessageReactionUpdatedMarkerFactory, + markerFactory: MarkerFactory? = ByChatIdChatMessageReactionUpdatedMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onChatMessageReactionUpdated( initialFilter, diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChosenInlineResultTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChosenInlineResultTriggers.kt index b4f7a00dfa..8a6729febc 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChosenInlineResultTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChosenInlineResultTriggers.kt @@ -13,7 +13,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update internal suspend inline fun BC.onChosenInlineResultBase( initialFilter: SimpleFilter? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByUserIdChosenInlineResultMarkerFactory, + markerFactory: MarkerFactory? = ByUserIdChosenInlineResultMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { (it.chosenInlineResultUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull) @@ -34,7 +34,7 @@ internal suspend inline fun BC.onChosenInlineResult( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByUserIdChosenInlineResultMarkerFactory, + markerFactory: MarkerFactory? = ByUserIdChosenInlineResultMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onChosenInlineResultBase( initialFilter, @@ -58,7 +58,7 @@ suspend fun BC.onChosenInlineResult( suspend fun BC.onLocationChosenInlineResult( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByUserIdChosenInlineResultMarkerFactory, + markerFactory: MarkerFactory? = ByUserIdChosenInlineResultMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onChosenInlineResultBase( initialFilter, @@ -82,7 +82,7 @@ suspend fun BC.onLocationChosenInlineResult( suspend fun BC.onBaseChosenInlineResult( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByUserIdChosenInlineResultMarkerFactory, + markerFactory: MarkerFactory? = ByUserIdChosenInlineResultMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onChosenInlineResultBase( initialFilter, diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt index bad353d964..f3044bb2aa 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt @@ -25,7 +25,7 @@ internal suspend fun BC.commandUncounted( requireOnlyCommandInMessage: Boolean = true, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ): Job = onText( CommonMessageFilter { message -> @@ -52,7 +52,7 @@ suspend fun BC.command( requireOnlyCommandInMessage: Boolean = true, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ): Job = runCatchingSafely { commandUncounted( @@ -81,7 +81,7 @@ suspend fun BC.command( requireOnlyCommandInMessage: Boolean = true, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = command(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -90,7 +90,7 @@ suspend fun BC.command( requireOnlyCommandInMessage: Boolean = true, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = command(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -99,7 +99,7 @@ suspend fun BC.onCommand( requireOnlyCommandInMessage: Boolean = true, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ): Job = command(commandRegex, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -108,7 +108,7 @@ suspend fun BC.onCommand( requireOnlyCommandInMessage: Boolean = true, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ): Job = onCommand(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -117,7 +117,7 @@ suspend fun BC.onCommand( requireOnlyCommandInMessage: Boolean = true, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ): Job = onCommand(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -125,7 +125,7 @@ suspend fun BC.commandWithArgs( commandRegex: Regex, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver> ) = command( @@ -146,7 +146,7 @@ suspend fun BC.commandWithArgs( command: String, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver> ) = commandWithArgs( @@ -162,7 +162,7 @@ suspend fun BC.commandWithArgs( botCommand: BotCommand, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver> ) = commandWithArgs( @@ -178,7 +178,7 @@ suspend fun BC.commandWithNamedArgs( commandRegex: Regex, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver>> @@ -200,7 +200,7 @@ suspend fun BC.commandWithNamedArgs( command: String, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver>> @@ -218,7 +218,7 @@ suspend fun BC.commandWithNamedArgs( botCommand: BotCommand, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver>> @@ -236,7 +236,7 @@ suspend fun BC.onCommandWithArgs( commandRegex: Regex, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver> ): Job = commandWithArgs( @@ -252,7 +252,7 @@ suspend fun BC.onCommandWithArgs( command: String, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver> ): Job = onCommandWithArgs( @@ -268,7 +268,7 @@ suspend fun BC.onCommandWithArgs( botCommand: BotCommand, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver> ): Job = onCommandWithArgs( @@ -284,7 +284,7 @@ suspend fun BC.onCommandWithNamedArgs( commandRegex: Regex, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver>> @@ -302,7 +302,7 @@ suspend fun BC.onCommandWithNamedArgs( command: String, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver>> @@ -320,7 +320,7 @@ suspend fun BC.onCommandWithNamedArgs( botCommand: BotCommand, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, argsSeparator: Regex = TelegramBotCommandsDefaults.defaultArgsSeparatorRegex, nameArgSeparator: Regex = TelegramBotCommandsDefaults.defaultNamesArgsSeparatorRegex, scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver>> diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandled.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandled.kt index de00275251..57abb71ea4 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandled.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandled.kt @@ -21,7 +21,7 @@ suspend fun BC.unhandledCommand( requireOnlyCommandInMessage: Boolean = true, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ): Job = onText( CommonMessageFilter { message -> @@ -49,7 +49,7 @@ suspend fun BC.onUnhandledCommand( requireOnlyCommandInMessage: Boolean = true, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ): Job = unhandledCommand(requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -57,7 +57,7 @@ suspend fun BC.onUnhandledCommand( suspend fun BC.unhandledCommandWithArgs( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver>> ) = onUnhandledCommand( requireOnlyCommandInMessage = false, @@ -75,6 +75,6 @@ suspend fun BC.unhandledCommandWithArgs( suspend fun BC.onUnhandledCommandWithArgs( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTwoTypesReceiver>> ): Job = unhandledCommandWithArgs(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt index 5d66a1ed66..17745ea21b 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt @@ -20,7 +20,7 @@ typealias CommonMessageFilter = SimpleFilter> internal suspend inline fun BC.onContentMessageWithType( initialFilter: CommonMessageFilter? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { when (it) { @@ -47,7 +47,7 @@ internal suspend inline fun suspend fun BC.onContentMessage( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onContentMessageWithType( initialFilter, @@ -71,7 +71,7 @@ suspend fun BC.onContentMessage( suspend fun BC.onContact( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -95,7 +95,7 @@ suspend fun BC.onContact( suspend fun BC.onDice( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -119,7 +119,7 @@ suspend fun BC.onDice( suspend fun BC.onGame( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -143,7 +143,7 @@ suspend fun BC.onGame( suspend fun BC.onLocation( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -167,7 +167,7 @@ suspend fun BC.onLocation( suspend fun BC.onLiveLocation( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -191,7 +191,7 @@ suspend fun BC.onLiveLocation( suspend fun BC.onStaticLocation( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -215,7 +215,7 @@ suspend fun BC.onStaticLocation( suspend fun BC.onPoll( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -239,7 +239,7 @@ suspend fun BC.onPoll( suspend fun BC.onText( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -263,7 +263,7 @@ suspend fun BC.onText( suspend fun BC.onStory( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -287,7 +287,7 @@ suspend fun BC.onStory( suspend fun BC.onTextedContent( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -311,7 +311,7 @@ suspend fun BC.onTextedContent( suspend fun BC.onVenue( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -335,7 +335,7 @@ suspend fun BC.onVenue( suspend fun BC.onAudioMediaGroup( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -359,7 +359,7 @@ suspend fun BC.onAudioMediaGroup( suspend fun BC.onDocumentMediaGroupContent( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -383,7 +383,7 @@ suspend fun BC.onDocumentMediaGroupContent( suspend fun BC.onTextedMediaContent( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -407,7 +407,7 @@ suspend fun BC.onTextedMediaContent( suspend fun BC.onMediaCollection( initialFilter: CommonMessageFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onContentMessageWithType( initialFilter, @@ -431,7 +431,7 @@ suspend fun BC.onMediaCollection( suspend fun BC.onMedia( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -455,7 +455,7 @@ suspend fun BC.onMedia( suspend fun BC.onAnimation( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -479,7 +479,7 @@ suspend fun BC.onAnimation( suspend fun BC.onAudio( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -503,7 +503,7 @@ suspend fun BC.onAudio( suspend fun BC.onDocument( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -527,7 +527,7 @@ suspend fun BC.onDocument( suspend fun BC.onPhoto( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -551,7 +551,7 @@ suspend fun BC.onPhoto( suspend fun BC.onSticker( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -575,7 +575,7 @@ suspend fun BC.onSticker( suspend fun BC.onVideo( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -599,7 +599,7 @@ suspend fun BC.onVideo( suspend fun BC.onVideoNote( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -623,7 +623,7 @@ suspend fun BC.onVideoNote( suspend fun BC.onVoice( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -647,7 +647,7 @@ suspend fun BC.onVoice( suspend fun BC.onInvoice( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -671,7 +671,7 @@ suspend fun BC.onInvoice( suspend fun BC.onVisualContent( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -695,7 +695,7 @@ suspend fun BC.onVisualContent( suspend fun BC.onMediaContent( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -719,7 +719,7 @@ suspend fun BC.onMediaContent( suspend fun BC.onGiveawayContent( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, @@ -744,7 +744,7 @@ suspend fun BC.onGiveawayContent( suspend fun BC.onGiveawayPublicResultsContent( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onContentMessageWithType( initialFilter, diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeepLinkHandling.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeepLinkHandling.kt index 91b1f03872..d56faac244 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeepLinkHandling.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeepLinkHandling.kt @@ -21,7 +21,7 @@ private val startRegex = Regex("start") suspend fun BC.onDeepLink( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = { (message, _), update -> MessageFilterByChat(this, message, update) }, - markerFactory: MarkerFactory, Any> = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) }, + markerFactory: MarkerFactory, Any>? = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) }, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ): Job = on( markerFactory, @@ -47,7 +47,7 @@ suspend fun BC.onDeepLink( regex: Regex, initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = { (message, _), update -> MessageFilterByChat(this, message, update) }, - markerFactory: MarkerFactory, Any> = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) }, + markerFactory: MarkerFactory, Any>? = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) }, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ): Job { val internalFilter = SimpleFilter> { @@ -60,6 +60,6 @@ suspend fun BC.onDeepLink( deepLink: String, initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = { (message, _), update -> MessageFilterByChat(this, message, update) }, - markerFactory: MarkerFactory, Any> = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) }, + markerFactory: MarkerFactory, Any>? = MarkerFactory { (message, _) -> ByChatMessageMarkerFactory(message) }, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ): Job = onDeepLink(Regex("^$deepLink$"), initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeletedBusinessMessagesTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeletedBusinessMessagesTriggers.kt index 3e5b2be96a..61be99d40f 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeletedBusinessMessagesTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeletedBusinessMessagesTriggers.kt @@ -30,7 +30,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update suspend fun BC.onBusinessMessagesDeleted( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByBusinessConnectionIdBusinessMessagesDeletedMarkerFactory, + markerFactory: MarkerFactory? = ByBusinessConnectionIdBusinessMessagesDeletedMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { (it.deletedBusinessMessageUpdateOrNull() ?.data) ?.let(::listOfNotNull) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt index 1978e5540f..0663a3313d 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt @@ -17,7 +17,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update internal suspend inline fun BC.onEditedContent( initialFilter: CommonMessageFilter? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { it.baseEditMessageUpdateOrNull() ?.data ?.withContent() ?.let(::listOfNotNull) @@ -39,7 +39,7 @@ internal suspend inline fun suspend fun BC.onEditedContentMessage( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> )= onEditedContent( initialFilter, @@ -63,7 +63,7 @@ suspend fun BC.onEditedContentMessage( suspend fun BC.onEditedContact( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -87,7 +87,7 @@ suspend fun BC.onEditedContact( suspend fun BC.onEditedDice( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -111,7 +111,7 @@ suspend fun BC.onEditedDice( suspend fun BC.onEditedGame( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -135,7 +135,7 @@ suspend fun BC.onEditedGame( suspend fun BC.onEditedLocation( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -159,7 +159,7 @@ suspend fun BC.onEditedLocation( suspend fun BC.onEditedText( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -183,7 +183,7 @@ suspend fun BC.onEditedText( suspend fun BC.onEditedVenue( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -207,7 +207,7 @@ suspend fun BC.onEditedVenue( suspend fun BC.onEditedAudioMediaGroup( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -231,7 +231,7 @@ suspend fun BC.onEditedAudioMediaGroup( suspend fun BC.onEditedDocumentMediaGroupContent( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -255,7 +255,7 @@ suspend fun BC.onEditedDocumentMediaGroupContent( suspend fun BC.onEditedTextedMediaContent( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -279,7 +279,7 @@ suspend fun BC.onEditedTextedMediaContent( suspend fun BC.onEditedMediaCollection( initialFilter: CommonMessageFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> )= onEditedContent( initialFilter, @@ -303,7 +303,7 @@ suspend fun BC.onEditedMediaCollection( suspend fun BC.onEditedMedia( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -327,7 +327,7 @@ suspend fun BC.onEditedMedia( suspend fun BC.onEditedAnimation( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -351,7 +351,7 @@ suspend fun BC.onEditedAnimation( suspend fun BC.onEditedAudio( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -375,7 +375,7 @@ suspend fun BC.onEditedAudio( suspend fun BC.onEditedDocument( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -399,7 +399,7 @@ suspend fun BC.onEditedDocument( suspend fun BC.onEditedPhoto( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -423,7 +423,7 @@ suspend fun BC.onEditedPhoto( suspend fun BC.onEditedSticker( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -447,7 +447,7 @@ suspend fun BC.onEditedSticker( suspend fun BC.onEditedVideo( initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -471,7 +471,7 @@ suspend fun BC.onEditedVideo( suspend fun BC.onEditedVideoNote( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -495,7 +495,7 @@ suspend fun BC.onEditedVideoNote( suspend fun BC.onEditedVoice( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, @@ -519,7 +519,7 @@ suspend fun BC.onEditedVoice( suspend fun BC.onEditedInvoice( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver )= onEditedContent( initialFilter, diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt index eb60a8b17f..47f188ca40 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt @@ -33,7 +33,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update internal suspend inline fun BC.onEvent( initialFilter: SimpleFilter>? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { @Suppress("UNCHECKED_CAST") @@ -43,7 +43,7 @@ internal suspend inline fun BC.on internal suspend inline fun > BC.onEventWithCustomChatEventMessage( initialFilter: SimpleFilter? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { @Suppress("UNCHECKED_CAST") @@ -65,7 +65,7 @@ internal suspend inline fun BC.onChannelEvent( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -84,7 +84,7 @@ suspend fun BC.onChannelEvent( suspend fun BC.onPrivateEvent( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -103,7 +103,7 @@ suspend fun BC.onPrivateEvent( suspend fun BC.onChatEvent( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -122,7 +122,7 @@ suspend fun BC.onChatEvent( suspend fun BC.onVideoChatEvent( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -141,7 +141,7 @@ suspend fun BC.onVideoChatEvent( suspend fun BC.onVideoChatStartedEvent( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -160,7 +160,7 @@ suspend fun BC.onVideoChatStartedEvent( suspend fun BC.onVideoChatEndedEvent( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -179,7 +179,7 @@ suspend fun BC.onVideoChatEndedEvent( suspend fun BC.onVideoChatParticipantsInvitedEvent( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -198,7 +198,7 @@ suspend fun BC.onVideoChatParticipantsInvitedEvent( suspend fun BC.onMessageAutoDeleteTimerChangedEvent( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -217,7 +217,7 @@ suspend fun BC.onMessageAutoDeleteTimerChangedEvent( suspend fun BC.onPublicChatEvent( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -236,7 +236,7 @@ suspend fun BC.onPublicChatEvent( suspend fun BC.onCommonEvent( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -255,7 +255,7 @@ suspend fun BC.onCommonEvent( suspend fun BC.onGroupEvent( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -274,7 +274,7 @@ suspend fun BC.onGroupEvent( suspend fun BC.onSupergroupEvent( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -293,7 +293,7 @@ suspend fun BC.onSupergroupEvent( suspend fun BC.onChannelChatCreated( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -312,7 +312,7 @@ suspend fun BC.onChannelChatCreated( suspend fun BC.onDeleteChatPhoto( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -331,7 +331,7 @@ suspend fun BC.onDeleteChatPhoto( suspend fun BC.onGroupChatCreated( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -350,7 +350,7 @@ suspend fun BC.onGroupChatCreated( suspend fun BC.onLeftChatMember( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -369,7 +369,7 @@ suspend fun BC.onLeftChatMember( suspend fun BC.onNewChatMembers( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -388,7 +388,7 @@ suspend fun BC.onNewChatMembers( suspend fun BC.onNewChatPhoto( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -407,7 +407,7 @@ suspend fun BC.onNewChatPhoto( suspend fun BC.onNewChatTitle( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -426,7 +426,7 @@ suspend fun BC.onNewChatTitle( suspend fun BC.onPinnedMessage( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -445,7 +445,7 @@ suspend fun BC.onPinnedMessage( suspend fun BC.onProximityAlertTriggered( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -464,7 +464,7 @@ suspend fun BC.onProximityAlertTriggered( suspend fun BC.onSupergroupChatCreated( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -486,7 +486,7 @@ suspend fun BC.onSupergroupChatCreated( suspend fun BC.onSuccessfulPayment( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -505,7 +505,7 @@ suspend fun BC.onSuccessfulPayment( suspend fun BC.onUserLoggedIn( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEvent(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -524,7 +524,7 @@ suspend fun BC.onUserLoggedIn( suspend fun BC.onWebAppData( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -543,7 +543,7 @@ suspend fun BC.onWebAppData( suspend fun BC.onForumTopicClosed( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -562,7 +562,7 @@ suspend fun BC.onForumTopicClosed( suspend fun BC.onForumTopicCreated( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -581,7 +581,7 @@ suspend fun BC.onForumTopicCreated( suspend fun BC.onForumTopicReopened( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -601,7 +601,7 @@ suspend fun BC.onForumTopicReopened( suspend fun BC.onForumTopicEdited( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -620,7 +620,7 @@ suspend fun BC.onForumTopicEdited( suspend fun BC.onGeneralForumTopicHidden( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -639,7 +639,7 @@ suspend fun BC.onGeneralForumTopicHidden( suspend fun BC.onGeneralForumTopicUnhidden( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -659,7 +659,7 @@ suspend fun BC.onGeneralForumTopicUnhidden( suspend fun BC.onWriteAccessAllowed( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -679,7 +679,7 @@ suspend fun BC.onWriteAccessAllowed( suspend fun BC.onWriteAccessAllowedFromRequest( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -699,7 +699,7 @@ suspend fun BC.onWriteAccessAllowedFromRequest( suspend fun BC.onWriteAccessAllowedFromAttachmentMenu( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -719,7 +719,7 @@ suspend fun BC.onWriteAccessAllowedFromAttachmentMenu( suspend fun BC.onWriteAccessAllowedOther( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -739,7 +739,7 @@ suspend fun BC.onWriteAccessAllowedOther( suspend fun BC.onWriteAccessAllowedFromWebAppLink( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -760,7 +760,7 @@ suspend fun BC.onWriteAccessAllowedFromWebAppLink( suspend fun BC.onChatSharedRequest( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -780,7 +780,7 @@ suspend fun BC.onChatSharedRequest( suspend fun BC.onUsersShared( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -800,7 +800,7 @@ suspend fun BC.onUsersShared( suspend fun BC.onUserShared( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onUsersShared(initialFilter * { it.chatEvent.userIds.size == 1 }, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -821,7 +821,7 @@ suspend fun BC.onUserShared( suspend fun BC.onChatShared( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -842,7 +842,7 @@ suspend fun BC.onChatShared( suspend fun BC.onChatBoostAdded( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -862,6 +862,6 @@ suspend fun BC.onChatBoostAdded( suspend fun BC.onChatBackgroundSet( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = MessageFilterByChat, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onEventWithCustomChatEventMessage(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/InlineQueryTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/InlineQueryTriggers.kt index 8106a24084..b81d71c033 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/InlineQueryTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/InlineQueryTriggers.kt @@ -12,7 +12,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update internal suspend inline fun BC.onInlineQuery( initialFilter: SimpleFilter? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = InlineQueryFilterByUser, - markerFactory: MarkerFactory = ByUserInlineQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserInlineQueryMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { (it.inlineQueryUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull) @@ -33,7 +33,7 @@ internal suspend inline fun BC. suspend fun BC.onAnyInlineQuery( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = InlineQueryFilterByUser, - markerFactory: MarkerFactory = ByUserInlineQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserInlineQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onInlineQuery(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -53,7 +53,7 @@ suspend fun BC.onAnyInlineQuery( suspend fun BC.onBaseInlineQuery( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = InlineQueryFilterByUser, - markerFactory: MarkerFactory = ByUserInlineQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserInlineQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onInlineQuery(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -73,6 +73,6 @@ suspend fun BC.onBaseInlineQuery( suspend fun BC.onLocationInlineQuery( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = InlineQueryFilterByUser, - markerFactory: MarkerFactory = ByUserInlineQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserInlineQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onInlineQuery(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MainTrigger.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MainTrigger.kt index 73819a7fec..5103e4526c 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MainTrigger.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MainTrigger.kt @@ -1,5 +1,7 @@ package dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling +import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions +import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptionsAsync import dev.inmo.tgbotapi.extensions.behaviour_builder.* import dev.inmo.tgbotapi.extensions.behaviour_builder.expectations.expectFlow @@ -8,7 +10,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.Mar import dev.inmo.tgbotapi.types.update.abstracts.Update internal suspend inline fun BC.on( - markerFactory: MarkerFactory, + markerFactory: MarkerFactory?, initialFilter: SimpleFilter? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver, @@ -26,13 +28,23 @@ internal suspend inline fun BC.on( it to data } ?: emptyList() } -).subscribeSafelyWithoutExceptionsAsync( - scope, - { markerFactory(it.second) } -) { (update, triggerData) -> - createSubContextAndDoWithUpdatesFilter { - if (subcontextUpdatesFilter ?.invoke(this, triggerData, update) != false) { - scenarioReceiver(triggerData) +).run { + val handler: suspend (Pair) -> Unit = { (update, triggerData) -> + createSubContextAndDoWithUpdatesFilter { + if (subcontextUpdatesFilter ?.invoke(this, triggerData, update) != false) { + scenarioReceiver(triggerData) + } + } + } + markerFactory ?.let { + subscribeSafelyWithoutExceptionsAsync( + scope, + { markerFactory(it.second) }, + block = handler + ) + } ?: subscribeSafelyWithoutExceptions(scope) { + scope.launchSafelyWithoutExceptions { + handler(it) } } } diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupMessagesTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupMessagesTriggers.kt index b4f80f4fd5..2f705c4de6 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupMessagesTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupMessagesTriggers.kt @@ -18,7 +18,7 @@ import dev.inmo.tgbotapi.utils.PreviewFeature internal suspend inline fun BC.buildMediaGroupMessagesTrigger( initialFilter: SimpleFilter>? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { it.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull>() ?.let { @@ -45,7 +45,7 @@ internal suspend inline fun BC.onMediaGroupMessages( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -64,7 +64,7 @@ suspend fun BC.onMediaGroupMessages( suspend fun BC.onPlaylistMessages( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -83,7 +83,7 @@ suspend fun BC.onPlaylistMessages( suspend fun BC.onDocumentsGroupMessages( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -102,7 +102,7 @@ suspend fun BC.onDocumentsGroupMessages( suspend fun BC.onVisualGalleryMessages( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -121,7 +121,7 @@ suspend fun BC.onVisualGalleryMessages( suspend fun BC.onVisualMediaGroupMessages( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onVisualGalleryMessages(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -140,7 +140,7 @@ suspend fun BC.onVisualMediaGroupMessages( suspend fun BC.onPhotoGalleryMessages( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -159,6 +159,6 @@ suspend fun BC.onPhotoGalleryMessages( suspend fun BC.onVideoGalleryMessages( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory, Any>? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = buildMediaGroupMessagesTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupTriggers.kt index 16057119ae..95d2071332 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupTriggers.kt @@ -18,7 +18,7 @@ import dev.inmo.tgbotapi.utils.PreviewFeature internal suspend inline fun BC.buildMediaGroupTrigger( initialFilter: SimpleFilter>? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { it.baseSentMessageUpdateOrNull() ?.data ?.commonMessageOrNull() ?.withContentOrNull>() ?.let { @@ -45,7 +45,7 @@ internal suspend inline fun BC.onMediaGroup( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -64,7 +64,7 @@ suspend fun BC.onMediaGroup( suspend fun BC.onPlaylist( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -83,7 +83,7 @@ suspend fun BC.onPlaylist( suspend fun BC.onDocumentsGroup( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -102,7 +102,7 @@ suspend fun BC.onDocumentsGroup( suspend fun BC.onVisualGallery( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -121,7 +121,7 @@ suspend fun BC.onVisualGallery( suspend fun BC.onVisualMediaGroup( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onVisualGallery(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -140,7 +140,7 @@ suspend fun BC.onVisualMediaGroup( suspend fun BC.onPhotoGallery( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -159,6 +159,6 @@ suspend fun BC.onPhotoGallery( suspend fun BC.onVideoGallery( initialFilter: SimpleFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = buildMediaGroupTrigger(initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MentionTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MentionTriggers.kt index 1acc11d2dc..262371f8da 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MentionTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MentionTriggers.kt @@ -29,7 +29,7 @@ internal suspend inline fun B username: Username, initialFilter: CommonMessageFilter? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onContentMessageWithType( initialFilter * { @@ -44,7 +44,7 @@ internal suspend inline fun B userId: UserId, initialFilter: CommonMessageFilter? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onContentMessageWithType( initialFilter * { @@ -59,7 +59,7 @@ internal suspend inline fun B user: User, initialFilter: CommonMessageFilter? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onContentMessageWithType( initialFilter * { @@ -75,7 +75,7 @@ suspend fun BC.onMentionWithAnyContent( username: Username, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -83,7 +83,7 @@ suspend fun BC.onTextMentionWithAnyContent( userId: UserId, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -91,7 +91,7 @@ suspend fun BC.onMentionWithAnyContent( user: User, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -101,7 +101,7 @@ suspend fun BC.onMentionWithVoiceContent( username: Username, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -109,7 +109,7 @@ suspend fun BC.onTextMentionWithVoiceContent( userId: UserId, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -117,7 +117,7 @@ suspend fun BC.onMentionWithVoiceContent( user: User, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -127,7 +127,7 @@ suspend fun BC.onMentionWithMediaGroupContent( username: Username, initialFilter: CommonMessageFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver>, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver>> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -135,7 +135,7 @@ suspend fun BC.onTextMentionWithMediaGroupContent( userId: UserId, initialFilter: CommonMessageFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver>, Update>? = null, - markerFactory: MarkerFactory>, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory>, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver>> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -143,7 +143,7 @@ suspend fun BC.onMentionWithMediaGroupContent( user: User, initialFilter: CommonMessageFilter>? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver>, Update>? = null, - markerFactory: MarkerFactory>, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory>, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver>> ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -153,7 +153,7 @@ suspend fun BC.onMentionWithMediaGroupPartContent( username: Username, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -161,7 +161,7 @@ suspend fun BC.onTextMentionWithMediaGroupPartContent( userId: UserId, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -169,7 +169,7 @@ suspend fun BC.onMentionWithMediaGroupPartContent( user: User, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -179,7 +179,7 @@ suspend fun BC.onMentionWithAudioContent( username: Username, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -187,7 +187,7 @@ suspend fun BC.onTextMentionWithAudioContent( userId: UserId, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -195,7 +195,7 @@ suspend fun BC.onMentionWithAudioContent( user: User, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -205,7 +205,7 @@ suspend fun BC.onMentionWithDocumentContent( username: Username, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -213,7 +213,7 @@ suspend fun BC.onTextMentionWithDocumentContent( userId: UserId, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -221,7 +221,7 @@ suspend fun BC.onMentionWithDocumentContent( user: User, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -231,7 +231,7 @@ suspend fun BC.onMentionWithVisualMediaGroupPartContent( username: Username, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -239,7 +239,7 @@ suspend fun BC.onTextMentionWithVisualMediaGroupPartCont userId: UserId, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -247,7 +247,7 @@ suspend fun BC.onMentionWithVisualMediaGroupPartContent( user: User, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -257,7 +257,7 @@ suspend fun BC.onMentionWithVideoContent( username: Username, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -265,7 +265,7 @@ suspend fun BC.onTextMentionWithVideoContent( userId: UserId, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -273,7 +273,7 @@ suspend fun BC.onMentionWithVideoContent( user: User, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -283,7 +283,7 @@ suspend fun BC.onMentionWithPhotoContent( username: Username, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -291,7 +291,7 @@ suspend fun BC.onTextMentionWithPhotoContent( userId: UserId, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -299,7 +299,7 @@ suspend fun BC.onMentionWithPhotoContent( user: User, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -309,7 +309,7 @@ suspend fun BC.onMentionWithAnimationContent( username: Username, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -317,7 +317,7 @@ suspend fun BC.onTextMentionWithAnimationContent( userId: UserId, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -325,7 +325,7 @@ suspend fun BC.onMentionWithAnimationContent( user: User, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -335,7 +335,7 @@ suspend fun BC.onMentionWithTextContent( username: Username, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -343,7 +343,7 @@ suspend fun BC.onTextMentionWithTextContent( userId: UserId, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) @@ -351,7 +351,7 @@ suspend fun BC.onMentionWithTextContent( user: User, initialFilter: CommonMessageFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver, Update>? = null, - markerFactory: MarkerFactory, Any> = AnyMarkerFactory(), + markerFactory: MarkerFactory, Any>? = AnyMarkerFactory(), scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(user, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt index b4cd034da8..592fec7e31 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt @@ -14,7 +14,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update internal suspend inline fun BC.onPassportMessageWith( initialFilter: SimpleFilter? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { (it.messageUpdateOrNull() ?.data ?.passportMessageOrNull() ?.takeIf { it.passportData.data.any { it is T } }) ?.let(::listOfNotNull) @@ -36,7 +36,7 @@ internal suspend inline fun BC.onPassportMessage( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = MessageFilterByChat, - markerFactory: MarkerFactory = ByChatMessageMarkerFactory, + markerFactory: MarkerFactory? = ByChatMessageMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onPassportMessageWith( initialFilter, diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollAnswersTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollAnswersTriggers.kt index a09639754b..8e9c93f6e7 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollAnswersTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollAnswersTriggers.kt @@ -13,7 +13,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update internal suspend inline fun BC.onPollAnswered( initialFilter: SimpleFilter? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByIdPollAnswerMarkerFactory, + markerFactory: MarkerFactory? = ByIdPollAnswerMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { (it.pollAnswerUpdateOrNull() ?.data) ?.let(::listOfNotNull) @@ -34,7 +34,7 @@ internal suspend inline fun BC.onPollAnswered( suspend fun BC.onPollAnswer( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByIdPollAnswerMarkerFactory, + markerFactory: MarkerFactory? = ByIdPollAnswerMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onPollAnswered( initialFilter, diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollUpdatesTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollUpdatesTriggers.kt index c9098d600d..a0a98a5445 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollUpdatesTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollUpdatesTriggers.kt @@ -13,7 +13,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update internal suspend inline fun BC.onPollUpdatedBase( initialFilter: SimpleFilter? = null, noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByIdPollMarkerFactory, + markerFactory: MarkerFactory? = ByIdPollMarkerFactory, noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { (it.pollUpdateOrNull() ?.data as? T) ?.let(::listOfNotNull) @@ -34,7 +34,7 @@ internal suspend inline fun BC.onPollU suspend fun BC.onPollUpdates( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByIdPollMarkerFactory, + markerFactory: MarkerFactory? = ByIdPollMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onPollUpdatedBase( initialFilter, @@ -58,7 +58,7 @@ suspend fun BC.onPollUpdates( suspend fun BC.onRegularPollUpdates( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByIdPollMarkerFactory, + markerFactory: MarkerFactory? = ByIdPollMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onPollUpdatedBase( initialFilter, @@ -82,7 +82,7 @@ suspend fun BC.onRegularPollUpdates( suspend fun BC.onQuizPollUpdates( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - markerFactory: MarkerFactory = ByIdPollMarkerFactory, + markerFactory: MarkerFactory? = ByIdPollMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = onPollUpdatedBase( initialFilter, diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PreCheckoutQueryTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PreCheckoutQueryTriggers.kt index c53f1ecda0..463ea3e6fd 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PreCheckoutQueryTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PreCheckoutQueryTriggers.kt @@ -28,7 +28,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update suspend fun BC.onPreCheckoutQuery( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = PreCheckoutQueryFilterByUser, - markerFactory: MarkerFactory = ByUserPreCheckoutQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserPreCheckoutQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { (it.preCheckoutQueryUpdateOrNull() ?.data) ?.let(::listOfNotNull) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ShippingQueryTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ShippingQueryTriggers.kt index 1f82cf12cb..160ead60f5 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ShippingQueryTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ShippingQueryTriggers.kt @@ -28,7 +28,7 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update suspend fun BC.onShippingQuery( initialFilter: SimpleFilter? = null, subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = ShippingQueryFilterByUser, - markerFactory: MarkerFactory = ByUserShippingQueryMarkerFactory, + markerFactory: MarkerFactory? = ByUserShippingQueryMarkerFactory, scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = on(markerFactory, initialFilter, subcontextUpdatesFilter, scenarioReceiver) { (it.shippingQueryUpdateOrNull() ?.data) ?.let(::listOfNotNull) From 57122cc2f9bd4bd761448a8c3d5a08ff7f38862b Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 14 Jun 2024 17:28:37 +0600 Subject: [PATCH 04/12] update dependencies --- CHANGELOG.md | 6 ++++++ gradle/libs.versions.toml | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b63525f89a..c722f9c968 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ ## 14.0.2 +* `Version`: + * `Coroutines`: `1.8.0` -> `1.8.1` + * `Ktor`: `2.3.10` -> `2.3.11` + * `MicroUtils`: `0.20.45` -> `0.20.52` + * `KSLog`: `1.3.3` -> `1.3.4` + ## 14.0.1 * In `core` and `api` modules related to invoices changed their APIs to suite current API diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 7bcca67082..bcf927553e 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,19 +2,19 @@ kotlin = "1.9.23" kotlin-serialization = "1.6.3" -kotlin-coroutines = "1.8.0" +kotlin-coroutines = "1.8.1" javax-activation = "1.1.1" korlibs = "5.4.0" uuid = "0.8.4" -ktor = "2.3.10" +ktor = "2.3.11" ksp = "1.9.23-1.0.20" kotlin-poet = "1.16.0" -microutils = "0.20.45" -kslog = "1.3.3" +microutils = "0.20.52" +kslog = "1.3.4" versions = "0.51.0" From 86bd5eaa07df6d233be0ff4034c0d5f44ba2eb65 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 14 Jun 2024 17:33:51 +0600 Subject: [PATCH 05/12] fill changelog and change BehaviourContext updates flow subscription mechanism --- CHANGELOG.md | 14 ++++++++++---- .../behaviour_builder/BehaviourContext.kt | 2 +- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c722f9c968..d4c098a3fd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,10 +3,16 @@ ## 14.0.2 * `Version`: - * `Coroutines`: `1.8.0` -> `1.8.1` - * `Ktor`: `2.3.10` -> `2.3.11` - * `MicroUtils`: `0.20.45` -> `0.20.52` - * `KSLog`: `1.3.3` -> `1.3.4` + * `Coroutines`: `1.8.0` -> `1.8.1` + * `Ktor`: `2.3.10` -> `2.3.11` + * `MicroUtils`: `0.20.45` -> `0.20.52` + * `KSLog`: `1.3.3` -> `1.3.4` +* `BehaviourBuilder`: + * `BehaviourContext` updates listening job will be weakly subscribed. It means that `BehaviourContext` scope will + not be prevented from cancelling by this job anymore + * `BehaviourContext.doInContext` will not stop automatically current `BehaviourContext` job anymore + * `BehaviourContext.createSubContextAndDoWithUpdatesFilter` will use `supervisorScope` instead of + `LinkedSupervisorScope`. That will prevent scope leaking in runtime ## 14.0.1 diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt index 331de9ca6d..d6131aac84 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt @@ -87,7 +87,7 @@ class DefaultBehaviourContext( } else { it } - }.accumulatorFlow(scope) + }.accumulatorFlow(WeakScope(scope)) override val asUpdateReceiver: UpdateReceiver = additionalUpdatesSharedFlow::emit override fun copy( From 60fdbb8ac43528be16f90671bb65b9512b0bc337 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 14 Jun 2024 19:54:06 +0600 Subject: [PATCH 06/12] small improvement in BehaviourContext --- .../extensions/behaviour_builder/BehaviourContext.kt | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt index d6131aac84..1f96aef8cd 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/BehaviourContext.kt @@ -132,6 +132,8 @@ fun BC.createSubContext( /** * Launch [behaviourContextReceiver] in context of [this] as [BehaviourContext] and as [kotlin.coroutines.CoroutineContext] + * + * [this] [BehaviourContext] will **NOT** be closed automatically */ suspend fun BC.doInContext( behaviourContextReceiver: CustomBehaviourContextReceiver @@ -152,12 +154,10 @@ suspend fun BC.createSubContextAndDoWithUpdatesFilter ): T { return supervisorScope { createSubContext( - scope = this, + scope = this@supervisorScope, triggersHolder = triggersHolder, updatesUpstreamFlow = updatesUpstreamFlow - ).doInContext( - behaviourContextReceiver = behaviourContextReceiver - ) + ).behaviourContextReceiver() } } From 46c5c62e158d2cf2dedc912f67e7214e10c1214d Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 15 Jun 2024 12:36:14 +0600 Subject: [PATCH 07/12] rewrite MainTrigger as noinline --- .../behaviour_builder/expectations/Base.kt | 14 +++++++++--- .../triggers_handling/ContentTriggers.kt | 3 ++- .../triggers_handling/MainTrigger.kt | 22 +++++++++++-------- 3 files changed, 26 insertions(+), 13 deletions(-) diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/Base.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/Base.kt index 0b0eb2c008..8ad99d900e 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/Base.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/expectations/Base.kt @@ -38,7 +38,9 @@ suspend fun FlowsUpdatesFilter.expectFlow( filter: suspend (Update) -> List ): Flow { val flow = allUpdatesFlow.map { - val result = safelyWithResult { filter(it) } + val result = runCatching { + filter(it) + } if (result.isFailure || result.getOrThrow().isEmpty()) { if (cancelTrigger(it)) { cancelRequestFactory(it) ?.also { @@ -47,14 +49,20 @@ suspend fun FlowsUpdatesFilter.expectFlow( } } errorFactory(it) ?.also { errorRequest -> - safelyWithoutExceptions { bot.execute(errorRequest) } + runCatching { + bot.execute(errorRequest) + } } emptyList() } else { result.getOrThrow() } }.flatten() - initRequest ?.also { safelyWithoutExceptions { bot.execute(initRequest) } } + initRequest ?.also { + runCatching { + bot.execute(initRequest) + } + } return flow } diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt index 17745ea21b..9af75800eb 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt @@ -9,6 +9,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter 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.utils.whenCommonMessage +import dev.inmo.tgbotapi.extensions.utils.withContentOrNull import dev.inmo.tgbotapi.types.files.TelegramMediaFile import dev.inmo.tgbotapi.types.message.abstracts.CommonMessage import dev.inmo.tgbotapi.types.message.content.* @@ -27,7 +28,7 @@ internal suspend inline fun is BaseSentMessageUpdate -> it.data.whenCommonMessage(::listOfNotNull) else -> null } ?.mapNotNull { message -> - if (message.content is T) message as CommonMessage else null + message.withContentOrNull() } } diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MainTrigger.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MainTrigger.kt index 5103e4526c..1492cacaa1 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MainTrigger.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MainTrigger.kt @@ -9,12 +9,12 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory import dev.inmo.tgbotapi.types.update.abstracts.Update -internal suspend inline fun BC.on( +internal suspend fun BC.on( markerFactory: MarkerFactory?, initialFilter: SimpleFilter? = null, - noinline subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, - noinline scenarioReceiver: CustomBehaviourContextAndTypeReceiver, - noinline updateToData: (Update) -> List? + subcontextUpdatesFilter: CustomBehaviourContextAndTwoTypesReceiver? = null, + scenarioReceiver: CustomBehaviourContextAndTypeReceiver, + updateToData: (Update) -> List? ) = flowsUpdatesFilter.expectFlow( bot, filter = initialFilter ?.let { @@ -24,17 +24,21 @@ internal suspend inline fun BC.on( } ?: emptyList() } } ?: { - updateToData(it) ?.mapNotNull { data -> + updateToData(it) ?.map { data -> it to data } ?: emptyList() } ).run { - val handler: suspend (Pair) -> Unit = { (update, triggerData) -> - createSubContextAndDoWithUpdatesFilter { - if (subcontextUpdatesFilter ?.invoke(this, triggerData, update) != false) { - scenarioReceiver(triggerData) + val handler: suspend (Pair) -> Unit = subcontextUpdatesFilter ?.let { + { (update, triggerData) -> + createSubContextAndDoWithUpdatesFilter { + if (subcontextUpdatesFilter(this, triggerData, update)) { + scenarioReceiver(triggerData) + } } } + } ?: { (_, triggerData) -> + createSubContextAndDoWithUpdatesFilter(behaviourContextReceiver = { scenarioReceiver(triggerData) }) } markerFactory ?.let { subscribeSafelyWithoutExceptionsAsync( From fb2b912f9372673e8f5db7fc4ec5918165b84798 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 15 Jun 2024 13:05:16 +0600 Subject: [PATCH 08/12] update docs --- gradle.properties | 2 +- .../BusinessConnectionTriggers.kt | 15 +- .../CallbackQueryTriggers.kt | 80 ++++--- .../CallbackQueryTriggersUnhandled.kt | 15 +- .../ChatBoostRemovedTriggers.kt | 5 +- .../ChatBoostUpdatedTriggers.kt | 5 +- .../ChatJoinRequestTriggers.kt | 5 +- .../ChatMemberUpdatedTriggers.kt | 15 +- ...sageReactionCountUpdatedUpdatesTriggers.kt | 5 +- ...atMessageReactionUpdatedUpdatesTriggers.kt | 15 +- .../ChosenInlineResultTriggers.kt | 15 +- .../triggers_handling/CommandHandling.kt | 85 +++++++ .../CommandHandlingUnhandled.kt | 20 ++ .../triggers_handling/ContentTriggers.kt | 150 ++++++++----- .../triggers_handling/DeepLinkHandling.kt | 10 + .../DeletedBusinessMessagesTriggers.kt | 5 +- .../EditedContentTriggers.kt | 105 +++++---- .../triggers_handling/EventTriggers.kt | 210 +++++++++++------- .../triggers_handling/InlineQueryTriggers.kt | 15 +- .../MediaGroupMessagesTriggers.kt | 35 +-- .../triggers_handling/MediaGroupTriggers.kt | 35 +-- .../triggers_handling/MentionTriggers.kt | 165 ++++++++++++++ .../triggers_handling/PassportTriggers.kt | 5 +- .../triggers_handling/PollAnswersTriggers.kt | 5 +- .../triggers_handling/PollUpdatesTriggers.kt | 15 +- .../PreCheckoutQueryTriggers.kt | 5 +- .../ShippingQueryTriggers.kt | 5 +- 27 files changed, 740 insertions(+), 307 deletions(-) diff --git a/gradle.properties b/gradle.properties index 64f19b9f36..629ddf8b13 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ kotlin.incremental=true kotlin.incremental.js=true library_group=dev.inmo -library_version=14.0.2 +library_version=14.0.2-preview4 diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/BusinessConnectionTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/BusinessConnectionTriggers.kt index 45e61d0995..d98c162db4 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/BusinessConnectionTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/BusinessConnectionTriggers.kt @@ -19,8 +19,9 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -40,8 +41,9 @@ suspend fun BC.onBusinessConnection( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -60,8 +62,9 @@ suspend fun BC.onBusinessConnectionEnabled( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt index 15822ace95..07d81d044e 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggers.kt @@ -31,8 +31,9 @@ internal suspend inline fun B * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -73,8 +74,9 @@ internal suspend inline fun BC.onDataCallbackQuery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -127,8 +130,9 @@ suspend fun BC.onDataCallbackQuery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -153,8 +157,9 @@ suspend fun BC.onDataCallbackQuery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -177,8 +182,9 @@ suspend fun BC.onGameShortNameCallbackQuery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -201,8 +207,9 @@ suspend fun BC.onInlineMessageIdCallbackQuery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -227,8 +234,9 @@ suspend fun BC.onInlineMessageIdDataCallbackQuery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -255,8 +263,9 @@ suspend fun BC.onInlineMessageIdDataCallbackQuery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -281,8 +290,9 @@ suspend fun BC.onInlineMessageIdDataCallbackQuery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -305,8 +315,9 @@ suspend fun BC.onInlineMessageIdGameShortNameCallbackQue * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -329,8 +340,9 @@ suspend fun BC.onMessageCallbackQuery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -355,8 +367,9 @@ suspend fun BC.onMessageDataCallbackQuery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -383,8 +396,9 @@ suspend fun BC.onMessageDataCallbackQuery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -409,8 +423,9 @@ suspend fun BC.onMessageDataCallbackQuery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -433,8 +448,9 @@ suspend fun BC.onMessageGameShortNameCallbackQuery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggersUnhandled.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggersUnhandled.kt index 8b8d2ad746..01fa602bab 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggersUnhandled.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CallbackQueryTriggersUnhandled.kt @@ -18,8 +18,9 @@ import dev.inmo.tgbotapi.utils.PreviewFeature * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -43,8 +44,9 @@ suspend fun BC.onUnhandledDataCallbackQuery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -68,8 +70,9 @@ suspend fun BC.onUnhandledInlineMessageIdDataCallbackQue * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatBoostRemovedTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatBoostRemovedTriggers.kt index 1812aef540..84514846d0 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatBoostRemovedTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatBoostRemovedTriggers.kt @@ -19,8 +19,9 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatBoostUpdatedTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatBoostUpdatedTriggers.kt index 6695cfceff..1dc75a2d41 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatBoostUpdatedTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatBoostUpdatedTriggers.kt @@ -19,8 +19,9 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatJoinRequestTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatJoinRequestTriggers.kt index 523b169545..067c35fa3e 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatJoinRequestTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatJoinRequestTriggers.kt @@ -17,8 +17,9 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMemberUpdatedTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMemberUpdatedTriggers.kt index 1bcd9497bc..e963b4651c 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMemberUpdatedTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMemberUpdatedTriggers.kt @@ -31,8 +31,9 @@ internal suspend inline fun BC.onChatMemberUpdated( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -79,8 +81,9 @@ suspend fun BC.onCommonChatMemberUpdated( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMessageReactionCountUpdatedUpdatesTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMessageReactionCountUpdatedUpdatesTriggers.kt index e8d2f101c3..8a172e0906 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMessageReactionCountUpdatedUpdatesTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMessageReactionCountUpdatedUpdatesTriggers.kt @@ -23,8 +23,9 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMessageReactionUpdatedUpdatesTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMessageReactionUpdatedUpdatesTriggers.kt index 0afe522f72..d822f6bb9d 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMessageReactionUpdatedUpdatesTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChatMessageReactionUpdatedUpdatesTriggers.kt @@ -28,8 +28,9 @@ internal suspend inline fun BC.onChatMessageReactionUpdatedByUser( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -76,8 +78,9 @@ suspend fun BC.onChatMessageReactionUpdatedByChat( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChosenInlineResultTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChosenInlineResultTriggers.kt index 8a6729febc..0d3b24dec6 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChosenInlineResultTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ChosenInlineResultTriggers.kt @@ -26,8 +26,9 @@ internal suspend inline fun BC.onChosenInlineResult( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -74,8 +76,9 @@ suspend fun BC.onLocationChosenInlineResult( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt index f3044bb2aa..b791581b99 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandling.kt @@ -76,6 +76,11 @@ suspend fun BC.command( } }.getOrThrow() +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.command( command: String, requireOnlyCommandInMessage: Boolean = true, @@ -85,6 +90,11 @@ suspend fun BC.command( scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = command(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.command( botCommand: BotCommand, requireOnlyCommandInMessage: Boolean = true, @@ -94,6 +104,11 @@ suspend fun BC.command( scenarioReceiver: CustomBehaviourContextAndTypeReceiver ) = command(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onCommand( commandRegex: Regex, requireOnlyCommandInMessage: Boolean = true, @@ -103,6 +118,11 @@ suspend fun BC.onCommand( scenarioReceiver: CustomBehaviourContextAndTypeReceiver ): Job = command(commandRegex, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onCommand( command: String, requireOnlyCommandInMessage: Boolean = true, @@ -112,6 +132,11 @@ suspend fun BC.onCommand( scenarioReceiver: CustomBehaviourContextAndTypeReceiver ): Job = onCommand(command.toRegex(), requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onCommand( botCommand: BotCommand, requireOnlyCommandInMessage: Boolean = true, @@ -121,6 +146,11 @@ suspend fun BC.onCommand( scenarioReceiver: CustomBehaviourContextAndTypeReceiver ): Job = onCommand(botCommand.command, requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.commandWithArgs( commandRegex: Regex, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, @@ -142,6 +172,11 @@ suspend fun BC.commandWithArgs( scenarioReceiver(it, args) } +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.commandWithArgs( command: String, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, @@ -158,6 +193,11 @@ suspend fun BC.commandWithArgs( scenarioReceiver = scenarioReceiver ) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.commandWithArgs( botCommand: BotCommand, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, @@ -174,6 +214,11 @@ suspend fun BC.commandWithArgs( scenarioReceiver = scenarioReceiver ) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.commandWithNamedArgs( commandRegex: Regex, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, @@ -196,6 +241,11 @@ suspend fun BC.commandWithNamedArgs( scenarioReceiver(it, args) } +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.commandWithNamedArgs( command: String, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, @@ -214,6 +264,11 @@ suspend fun BC.commandWithNamedArgs( scenarioReceiver = scenarioReceiver ) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.commandWithNamedArgs( botCommand: BotCommand, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, @@ -232,6 +287,11 @@ suspend fun BC.commandWithNamedArgs( scenarioReceiver = scenarioReceiver ) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onCommandWithArgs( commandRegex: Regex, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, @@ -248,6 +308,11 @@ suspend fun BC.onCommandWithArgs( scenarioReceiver = scenarioReceiver ) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onCommandWithArgs( command: String, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, @@ -264,6 +329,11 @@ suspend fun BC.onCommandWithArgs( scenarioReceiver = scenarioReceiver ) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onCommandWithArgs( botCommand: BotCommand, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, @@ -280,6 +350,11 @@ suspend fun BC.onCommandWithArgs( scenarioReceiver = scenarioReceiver ) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onCommandWithNamedArgs( commandRegex: Regex, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, @@ -298,6 +373,11 @@ suspend fun BC.onCommandWithNamedArgs( scenarioReceiver = scenarioReceiver, ) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onCommandWithNamedArgs( command: String, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, @@ -316,6 +396,11 @@ suspend fun BC.onCommandWithNamedArgs( scenarioReceiver = scenarioReceiver ) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onCommandWithNamedArgs( botCommand: BotCommand, initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandled.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandled.kt index 57abb71ea4..8eb4a0805d 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandled.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/CommandHandlingUnhandled.kt @@ -16,6 +16,11 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update import dev.inmo.tgbotapi.utils.PreviewFeature import kotlinx.coroutines.Job +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ @PreviewFeature suspend fun BC.unhandledCommand( requireOnlyCommandInMessage: Boolean = true, @@ -44,6 +49,11 @@ suspend fun BC.unhandledCommand( scenarioReceiver ) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ @PreviewFeature suspend fun BC.onUnhandledCommand( requireOnlyCommandInMessage: Boolean = true, @@ -53,6 +63,11 @@ suspend fun BC.onUnhandledCommand( scenarioReceiver: CustomBehaviourContextAndTypeReceiver ): Job = unhandledCommand(requireOnlyCommandInMessage, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ @PreviewFeature suspend fun BC.unhandledCommandWithArgs( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, @@ -71,6 +86,11 @@ suspend fun BC.unhandledCommandWithArgs( scenarioReceiver(it, args) } +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ @PreviewFeature suspend fun BC.onUnhandledCommandWithArgs( initialFilter: CommonMessageFilter? = CommonMessageFilterExcludeMediaGroups, diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt index 9af75800eb..32a0d90bb6 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ContentTriggers.kt @@ -40,8 +40,9 @@ internal suspend inline fun * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -64,8 +65,9 @@ suspend fun BC.onContentMessage( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -88,8 +90,9 @@ suspend fun BC.onContact( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -112,8 +115,9 @@ suspend fun BC.onDice( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -136,8 +140,9 @@ suspend fun BC.onGame( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -160,8 +165,9 @@ suspend fun BC.onLocation( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -184,8 +190,9 @@ suspend fun BC.onLiveLocation( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -208,8 +215,9 @@ suspend fun BC.onStaticLocation( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -232,8 +240,9 @@ suspend fun BC.onPoll( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -256,8 +265,9 @@ suspend fun BC.onText( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -280,8 +290,9 @@ suspend fun BC.onStory( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -304,8 +315,9 @@ suspend fun BC.onTextedContent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -328,8 +340,9 @@ suspend fun BC.onVenue( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -352,8 +365,9 @@ suspend fun BC.onAudioMediaGroup( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -376,8 +390,9 @@ suspend fun BC.onDocumentMediaGroupContent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -400,8 +415,9 @@ suspend fun BC.onTextedMediaContent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -424,8 +440,9 @@ suspend fun BC.onMediaCollection( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -448,8 +465,9 @@ suspend fun BC.onMedia( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -472,8 +490,9 @@ suspend fun BC.onAnimation( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -496,8 +515,9 @@ suspend fun BC.onAudio( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -520,8 +540,9 @@ suspend fun BC.onDocument( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -544,8 +565,9 @@ suspend fun BC.onPhoto( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -568,8 +590,9 @@ suspend fun BC.onSticker( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -592,8 +615,9 @@ suspend fun BC.onVideo( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -616,8 +640,9 @@ suspend fun BC.onVideoNote( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -640,8 +665,9 @@ suspend fun BC.onVoice( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -664,8 +690,9 @@ suspend fun BC.onInvoice( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -688,8 +715,9 @@ suspend fun BC.onVisualContent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -712,8 +740,9 @@ suspend fun BC.onMediaContent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -737,8 +766,9 @@ suspend fun BC.onGiveawayContent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeepLinkHandling.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeepLinkHandling.kt index d56faac244..4862909143 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeepLinkHandling.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeepLinkHandling.kt @@ -43,6 +43,11 @@ suspend fun BC.onDeepLink( } } +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onDeepLink( regex: Regex, initialFilter: SimpleFilter>? = null, @@ -56,6 +61,11 @@ suspend fun BC.onDeepLink( return onDeepLink(initialFilter ?.let { internalFilter * it } ?: internalFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) } +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onDeepLink( deepLink: String, initialFilter: SimpleFilter>? = null, diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeletedBusinessMessagesTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeletedBusinessMessagesTriggers.kt index 61be99d40f..b8e8da2127 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeletedBusinessMessagesTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/DeletedBusinessMessagesTriggers.kt @@ -22,8 +22,9 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt index 0663a3313d..9d8b508b7f 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EditedContentTriggers.kt @@ -31,8 +31,9 @@ internal suspend inline fun * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -55,8 +56,9 @@ suspend fun BC.onEditedContentMessage( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -79,8 +81,9 @@ suspend fun BC.onEditedContact( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -103,8 +106,9 @@ suspend fun BC.onEditedDice( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -127,8 +131,9 @@ suspend fun BC.onEditedGame( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -151,8 +156,9 @@ suspend fun BC.onEditedLocation( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -175,8 +181,9 @@ suspend fun BC.onEditedText( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -199,8 +206,9 @@ suspend fun BC.onEditedVenue( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -223,8 +231,9 @@ suspend fun BC.onEditedAudioMediaGroup( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -247,8 +256,9 @@ suspend fun BC.onEditedDocumentMediaGroupContent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -271,8 +281,9 @@ suspend fun BC.onEditedTextedMediaContent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -295,8 +306,9 @@ suspend fun BC.onEditedMediaCollection( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -319,8 +331,9 @@ suspend fun BC.onEditedMedia( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -343,8 +356,9 @@ suspend fun BC.onEditedAnimation( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -367,8 +381,9 @@ suspend fun BC.onEditedAudio( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -391,8 +406,9 @@ suspend fun BC.onEditedDocument( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -415,8 +431,9 @@ suspend fun BC.onEditedPhoto( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -439,8 +456,9 @@ suspend fun BC.onEditedSticker( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -463,8 +481,9 @@ suspend fun BC.onEditedVideo( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -487,8 +506,9 @@ suspend fun BC.onEditedVideoNote( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -511,8 +531,9 @@ suspend fun BC.onEditedVoice( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt index 47f188ca40..8ff4fc5aaa 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/EventTriggers.kt @@ -57,8 +57,9 @@ internal suspend inline fun BC.onChannelEvent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -95,8 +97,9 @@ suspend fun BC.onPrivateEvent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -114,8 +117,9 @@ suspend fun BC.onChatEvent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -133,8 +137,9 @@ suspend fun BC.onVideoChatEvent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -152,8 +157,9 @@ suspend fun BC.onVideoChatStartedEvent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -171,8 +177,9 @@ suspend fun BC.onVideoChatEndedEvent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -190,8 +197,9 @@ suspend fun BC.onVideoChatParticipantsInvitedEvent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -209,8 +217,9 @@ suspend fun BC.onMessageAutoDeleteTimerChangedEvent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -228,8 +237,9 @@ suspend fun BC.onPublicChatEvent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -247,8 +257,9 @@ suspend fun BC.onCommonEvent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -266,8 +277,9 @@ suspend fun BC.onGroupEvent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -285,8 +297,9 @@ suspend fun BC.onSupergroupEvent( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -304,8 +317,9 @@ suspend fun BC.onChannelChatCreated( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -323,8 +337,9 @@ suspend fun BC.onDeleteChatPhoto( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -342,8 +357,9 @@ suspend fun BC.onGroupChatCreated( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -361,8 +377,9 @@ suspend fun BC.onLeftChatMember( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -380,8 +397,9 @@ suspend fun BC.onNewChatMembers( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -399,8 +417,9 @@ suspend fun BC.onNewChatPhoto( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -418,8 +437,9 @@ suspend fun BC.onNewChatTitle( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -437,8 +457,9 @@ suspend fun BC.onPinnedMessage( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -456,8 +477,9 @@ suspend fun BC.onProximityAlertTriggered( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -478,8 +500,9 @@ suspend fun BC.onSupergroupChatCreated( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -497,8 +520,9 @@ suspend fun BC.onSuccessfulPayment( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -516,8 +540,9 @@ suspend fun BC.onUserLoggedIn( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -535,8 +560,9 @@ suspend fun BC.onWebAppData( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -554,8 +580,9 @@ suspend fun BC.onForumTopicClosed( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -573,8 +600,9 @@ suspend fun BC.onForumTopicCreated( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -593,8 +621,9 @@ suspend fun BC.onForumTopicReopened( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -612,8 +641,9 @@ suspend fun BC.onForumTopicEdited( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -631,8 +661,9 @@ suspend fun BC.onGeneralForumTopicHidden( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -651,8 +682,9 @@ suspend fun BC.onGeneralForumTopicUnhidden( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -671,8 +703,9 @@ suspend fun BC.onWriteAccessAllowed( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -691,8 +724,9 @@ suspend fun BC.onWriteAccessAllowedFromRequest( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -711,8 +745,9 @@ suspend fun BC.onWriteAccessAllowedFromAttachmentMenu( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -731,8 +766,9 @@ suspend fun BC.onWriteAccessAllowedOther( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -752,8 +788,9 @@ suspend fun BC.onWriteAccessAllowedFromWebAppLink( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -772,8 +809,9 @@ suspend fun BC.onChatSharedRequest( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -792,8 +830,9 @@ suspend fun BC.onUsersShared( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -813,8 +852,9 @@ suspend fun BC.onUserShared( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -834,8 +874,9 @@ suspend fun BC.onChatShared( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -854,8 +895,9 @@ suspend fun BC.onChatBoostAdded( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param markerFactory Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/InlineQueryTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/InlineQueryTriggers.kt index b81d71c033..69518e093f 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/InlineQueryTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/InlineQueryTriggers.kt @@ -25,8 +25,9 @@ internal suspend inline fun BC. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -45,8 +46,9 @@ suspend fun BC.onAnyInlineQuery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -65,8 +67,9 @@ suspend fun BC.onBaseInlineQuery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupMessagesTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupMessagesTriggers.kt index 2f705c4de6..ef23f4913d 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupMessagesTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupMessagesTriggers.kt @@ -37,8 +37,9 @@ internal suspend inline fun BC.onMediaGroupMessages( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -75,8 +77,9 @@ suspend fun BC.onPlaylistMessages( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -94,8 +97,9 @@ suspend fun BC.onDocumentsGroupMessages( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -113,8 +117,9 @@ suspend fun BC.onVisualGalleryMessages( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -132,8 +137,9 @@ suspend fun BC.onVisualMediaGroupMessages( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -151,8 +157,9 @@ suspend fun BC.onPhotoGalleryMessages( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupTriggers.kt index 95d2071332..ec5ea5f21b 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MediaGroupTriggers.kt @@ -37,8 +37,9 @@ internal suspend inline fun BC.onMediaGroup( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -75,8 +77,9 @@ suspend fun BC.onPlaylist( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -94,8 +97,9 @@ suspend fun BC.onDocumentsGroup( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -113,8 +117,9 @@ suspend fun BC.onVisualGallery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -132,8 +137,9 @@ suspend fun BC.onVisualMediaGroup( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -151,8 +157,9 @@ suspend fun BC.onPhotoGallery( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MentionTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MentionTriggers.kt index 262371f8da..f93ac56d7f 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MentionTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/MentionTriggers.kt @@ -71,6 +71,11 @@ internal suspend inline fun B ) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithAnyContent( username: Username, initialFilter: CommonMessageFilter? = null, @@ -79,6 +84,11 @@ suspend fun BC.onMentionWithAnyContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onTextMentionWithAnyContent( userId: UserId, initialFilter: CommonMessageFilter? = null, @@ -87,6 +97,11 @@ suspend fun BC.onTextMentionWithAnyContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithAnyContent( user: User, initialFilter: CommonMessageFilter? = null, @@ -97,6 +112,11 @@ suspend fun BC.onMentionWithAnyContent( +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithVoiceContent( username: Username, initialFilter: CommonMessageFilter? = null, @@ -105,6 +125,11 @@ suspend fun BC.onMentionWithVoiceContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onTextMentionWithVoiceContent( userId: UserId, initialFilter: CommonMessageFilter? = null, @@ -113,6 +138,11 @@ suspend fun BC.onTextMentionWithVoiceContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithVoiceContent( user: User, initialFilter: CommonMessageFilter? = null, @@ -123,6 +153,11 @@ suspend fun BC.onMentionWithVoiceContent( +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithMediaGroupContent( username: Username, initialFilter: CommonMessageFilter>? = null, @@ -131,6 +166,11 @@ suspend fun BC.onMentionWithMediaGroupContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver>> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onTextMentionWithMediaGroupContent( userId: UserId, initialFilter: CommonMessageFilter>? = null, @@ -139,6 +179,11 @@ suspend fun BC.onTextMentionWithMediaGroupContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver>> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithMediaGroupContent( user: User, initialFilter: CommonMessageFilter>? = null, @@ -149,6 +194,11 @@ suspend fun BC.onMentionWithMediaGroupContent( +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithMediaGroupPartContent( username: Username, initialFilter: CommonMessageFilter? = null, @@ -157,6 +207,11 @@ suspend fun BC.onMentionWithMediaGroupPartContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onTextMentionWithMediaGroupPartContent( userId: UserId, initialFilter: CommonMessageFilter? = null, @@ -165,6 +220,11 @@ suspend fun BC.onTextMentionWithMediaGroupPartContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithMediaGroupPartContent( user: User, initialFilter: CommonMessageFilter? = null, @@ -175,6 +235,11 @@ suspend fun BC.onMentionWithMediaGroupPartContent( +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithAudioContent( username: Username, initialFilter: CommonMessageFilter? = null, @@ -183,6 +248,11 @@ suspend fun BC.onMentionWithAudioContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onTextMentionWithAudioContent( userId: UserId, initialFilter: CommonMessageFilter? = null, @@ -191,6 +261,11 @@ suspend fun BC.onTextMentionWithAudioContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithAudioContent( user: User, initialFilter: CommonMessageFilter? = null, @@ -201,6 +276,11 @@ suspend fun BC.onMentionWithAudioContent( +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithDocumentContent( username: Username, initialFilter: CommonMessageFilter? = null, @@ -209,6 +289,11 @@ suspend fun BC.onMentionWithDocumentContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onTextMentionWithDocumentContent( userId: UserId, initialFilter: CommonMessageFilter? = null, @@ -217,6 +302,11 @@ suspend fun BC.onTextMentionWithDocumentContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithDocumentContent( user: User, initialFilter: CommonMessageFilter? = null, @@ -227,6 +317,11 @@ suspend fun BC.onMentionWithDocumentContent( +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithVisualMediaGroupPartContent( username: Username, initialFilter: CommonMessageFilter? = null, @@ -235,6 +330,11 @@ suspend fun BC.onMentionWithVisualMediaGroupPartContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onTextMentionWithVisualMediaGroupPartContent( userId: UserId, initialFilter: CommonMessageFilter? = null, @@ -243,6 +343,11 @@ suspend fun BC.onTextMentionWithVisualMediaGroupPartCont scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithVisualMediaGroupPartContent( user: User, initialFilter: CommonMessageFilter? = null, @@ -253,6 +358,11 @@ suspend fun BC.onMentionWithVisualMediaGroupPartContent( +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithVideoContent( username: Username, initialFilter: CommonMessageFilter? = null, @@ -261,6 +371,11 @@ suspend fun BC.onMentionWithVideoContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onTextMentionWithVideoContent( userId: UserId, initialFilter: CommonMessageFilter? = null, @@ -269,6 +384,11 @@ suspend fun BC.onTextMentionWithVideoContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithVideoContent( user: User, initialFilter: CommonMessageFilter? = null, @@ -279,6 +399,11 @@ suspend fun BC.onMentionWithVideoContent( +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithPhotoContent( username: Username, initialFilter: CommonMessageFilter? = null, @@ -287,6 +412,11 @@ suspend fun BC.onMentionWithPhotoContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onTextMentionWithPhotoContent( userId: UserId, initialFilter: CommonMessageFilter? = null, @@ -295,6 +425,11 @@ suspend fun BC.onTextMentionWithPhotoContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithPhotoContent( user: User, initialFilter: CommonMessageFilter? = null, @@ -305,6 +440,11 @@ suspend fun BC.onMentionWithPhotoContent( +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithAnimationContent( username: Username, initialFilter: CommonMessageFilter? = null, @@ -313,6 +453,11 @@ suspend fun BC.onMentionWithAnimationContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onTextMentionWithAnimationContent( userId: UserId, initialFilter: CommonMessageFilter? = null, @@ -321,6 +466,11 @@ suspend fun BC.onTextMentionWithAnimationContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithAnimationContent( user: User, initialFilter: CommonMessageFilter? = null, @@ -331,6 +481,11 @@ suspend fun BC.onMentionWithAnimationContent( +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithTextContent( username: Username, initialFilter: CommonMessageFilter? = null, @@ -339,6 +494,11 @@ suspend fun BC.onMentionWithTextContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onMention(username, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onTextMentionWithTextContent( userId: UserId, initialFilter: CommonMessageFilter? = null, @@ -347,6 +507,11 @@ suspend fun BC.onTextMentionWithTextContent( scenarioReceiver: CustomBehaviourContextAndTypeReceiver> ) = onTextMention(userId, initialFilter, subcontextUpdatesFilter, markerFactory, scenarioReceiver) +/** + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" + */ suspend fun BC.onMentionWithTextContent( user: User, initialFilter: CommonMessageFilter? = null, diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt index 592fec7e31..608690b12f 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PassportTriggers.kt @@ -28,8 +28,9 @@ internal suspend inline fun BC.onPollAnswered( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollUpdatesTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollUpdatesTriggers.kt index a0a98a5445..f7ce9810b5 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollUpdatesTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PollUpdatesTriggers.kt @@ -26,8 +26,9 @@ internal suspend inline fun BC.onPollU * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -50,8 +51,9 @@ suspend fun BC.onPollUpdates( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ @@ -74,8 +76,9 @@ suspend fun BC.onRegularPollUpdates( * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PreCheckoutQueryTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PreCheckoutQueryTriggers.kt index 463ea3e6fd..8b2bb853e7 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PreCheckoutQueryTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/PreCheckoutQueryTriggers.kt @@ -20,8 +20,9 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ diff --git a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ShippingQueryTriggers.kt b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ShippingQueryTriggers.kt index 160ead60f5..bc2aa01ba5 100644 --- a/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ShippingQueryTriggers.kt +++ b/tgbotapi.behaviour_builder/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/behaviour_builder/triggers_handling/ShippingQueryTriggers.kt @@ -20,8 +20,9 @@ import dev.inmo.tgbotapi.types.update.abstracts.Update * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.BehaviourContextAndTwoTypesReceiver] function to create your own. * Use [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus] or [dev.inmo.tgbotapi.extensions.behaviour_builder.utils.times] * to combinate several filters - * @param [markerFactory] Will be used to identify different "stream". [scenarioReceiver] will be called synchronously - * in one "stream". Output of [markerFactory] will be used as a key for "stream" + * @param [markerFactory] **Pass null to handle requests fully parallel**. Will be used to identify different "stream". + * [scenarioReceiver] will be called synchronously in one "stream". Output of [markerFactory] will be used as a key for + * "stream" * @param scenarioReceiver Main callback which will be used to handle incoming data if [initialFilter] will pass that * data */ From c3fa8a6d33d754e88f1c43c06b3e3b76273296d2 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 16 Jun 2024 00:29:13 +0600 Subject: [PATCH 09/12] update microutils dependency --- gradle.properties | 2 +- gradle/libs.versions.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/gradle.properties b/gradle.properties index 629ddf8b13..fa5adf3574 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ kotlin.incremental=true kotlin.incremental.js=true library_group=dev.inmo -library_version=14.0.2-preview4 +library_version=14.0.2-preview5 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index bcf927553e..b3a4ad3455 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ ktor = "2.3.11" ksp = "1.9.23-1.0.20" kotlin-poet = "1.16.0" -microutils = "0.20.52" +microutils = "0.20.53" kslog = "1.3.4" versions = "0.51.0" From abbb4e2dff4b5f42976a25ecb0125ee9c172b351 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 16 Jun 2024 22:34:44 +0600 Subject: [PATCH 10/12] update microutils --- gradle.properties | 2 +- gradle/libs.versions.toml | 2 +- .../dev/inmo/tgbotapi/extensions/api/LiveFlowLocation.kt | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/gradle.properties b/gradle.properties index fa5adf3574..81d95ddd65 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ kotlin.incremental=true kotlin.incremental.js=true library_group=dev.inmo -library_version=14.0.2-preview5 +library_version=14.0.2-preview6 diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b3a4ad3455..6d62212c3d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ ktor = "2.3.11" ksp = "1.9.23-1.0.20" kotlin-poet = "1.16.0" -microutils = "0.20.53" +microutils = "0.20.53-preview1" kslog = "1.3.4" versions = "0.51.0" diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveFlowLocation.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveFlowLocation.kt index 23c8fa19ee..261d23379b 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveFlowLocation.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/LiveFlowLocation.kt @@ -1,6 +1,7 @@ package dev.inmo.tgbotapi.extensions.api import dev.inmo.micro_utils.coroutines.LinkedSupervisorJob +import dev.inmo.micro_utils.coroutines.LinkedSupervisorScope import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions import dev.inmo.tgbotapi.abstracts.* import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup @@ -54,8 +55,9 @@ suspend fun TelegramBot.handleLiveLocation( val updateMessageJob = if (liveTimeMillis == indefiniteLivePeriodDelayMillis) { // do not launch refreshing of message for indefinite live locations null } else { - CoroutineScope(currentCoroutineContext().LinkedSupervisorJob()).launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) { - while (isActive) { + val scope = currentCoroutineContext().LinkedSupervisorScope() + scope.launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) { + while (scope.isActive) { delay(liveTimeMillis) // Remove previous location message info to resend live location message currentLiveLocationMessage = null From 738728f647ce9443c5154da1c1c73df9baa4e716 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 21 Jun 2024 13:21:05 +0600 Subject: [PATCH 11/12] Update libs.versions.toml --- gradle/libs.versions.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 6d62212c3d..c7e4b00f61 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -13,7 +13,7 @@ ktor = "2.3.11" ksp = "1.9.23-1.0.20" kotlin-poet = "1.16.0" -microutils = "0.20.53-preview1" +microutils = "0.21.0" kslog = "1.3.4" versions = "0.51.0" From a3ef66bbfbae27bae1a85a2dbc615352e5d0d16a Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 21 Jun 2024 13:30:13 +0600 Subject: [PATCH 12/12] migration due to potential breaking changes in microutils --- CHANGELOG.md | 4 ++-- gradle.properties | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d4c098a3fd..0518abb23f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,11 @@ # TelegramBotAPI changelog -## 14.0.2 +## 14.1.0 * `Version`: * `Coroutines`: `1.8.0` -> `1.8.1` * `Ktor`: `2.3.10` -> `2.3.11` - * `MicroUtils`: `0.20.45` -> `0.20.52` + * `MicroUtils`: `0.20.45` -> `0.21.0` * `KSLog`: `1.3.3` -> `1.3.4` * `BehaviourBuilder`: * `BehaviourContext` updates listening job will be weakly subscribed. It means that `BehaviourContext` scope will diff --git a/gradle.properties b/gradle.properties index 81d95ddd65..5af7457d09 100644 --- a/gradle.properties +++ b/gradle.properties @@ -6,4 +6,4 @@ kotlin.incremental=true kotlin.incremental.js=true library_group=dev.inmo -library_version=14.0.2-preview6 +library_version=14.1.0