1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 08:13:47 +00:00

fixes in callback query triggers

This commit is contained in:
InsanusMokrassar 2022-07-31 17:49:48 +06:00
parent ea981605f6
commit 0a0a7cea0e
2 changed files with 7 additions and 5 deletions

View File

@ -2,6 +2,9 @@
## 2.2.2
* `Behaviour Builder`:
* Fixes in `CallbackQuery` triggers
## 2.2.1
* `Versions`:

View File

@ -6,10 +6,9 @@ import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
import dev.inmo.micro_utils.coroutines.runCatchingSafely
import dev.inmo.tgbotapi.extensions.behaviour_builder.*
import dev.inmo.tgbotapi.extensions.behaviour_builder.filters.CallbackQueryFilterByUser
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.SimpleFilter
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.*
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.ByUserCallbackQueryMarkerFactory
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.marker_factories.MarkerFactory
import dev.inmo.tgbotapi.extensions.behaviour_builder.utils.plus
import dev.inmo.tgbotapi.extensions.utils.asCallbackQueryUpdate
import dev.inmo.tgbotapi.types.queries.callback.*
import dev.inmo.tgbotapi.types.update.abstracts.Update
@ -111,7 +110,7 @@ suspend fun <BC : BehaviourContext> BC.onDataCallbackQuery(
markerFactory: MarkerFactory<in DataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, DataCallbackQuery>
) = onDataCallbackQuery(
initialFilter = initialFilter + {
initialFilter = initialFilter * {
it.data.matches(dataRegex)
},
subcontextUpdatesFilter,
@ -239,7 +238,7 @@ suspend fun <BC : BehaviourContext> BC.onInlineMessageIdDataCallbackQuery(
markerFactory: MarkerFactory<in InlineMessageIdDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, InlineMessageIdDataCallbackQuery>
) = onInlineMessageIdDataCallbackQuery(
initialFilter = initialFilter + {
initialFilter = initialFilter * {
it.data.matches(dataRegex)
},
subcontextUpdatesFilter,
@ -367,7 +366,7 @@ suspend fun <BC : BehaviourContext> BC.onMessageDataCallbackQuery(
markerFactory: MarkerFactory<in MessageDataCallbackQuery, Any> = ByUserCallbackQueryMarkerFactory,
scenarioReceiver: CustomBehaviourContextAndTypeReceiver<BC, Unit, MessageDataCallbackQuery>
) = onMessageDataCallbackQuery(
initialFilter = initialFilter + {
initialFilter = initialFilter * {
it.data.matches(dataRegex)
},
subcontextUpdatesFilter,