diff --git a/CHANGELOG.md b/CHANGELOG.md index 6adfae5c17..3b9cab7453 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 0.30.13 +* `Core`: + * New variable `FlowsUpdatesFilter#allUpdatesWithoutMediaGroupsGroupingFlow` which will contains updates without + `SentMediaGroupUpdate` * `Utils`: * Extensions for `ResendableContent` has been added * Extensions for `TextSource` has been added diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter.kt index 1e8adcf5f0..ddf006e887 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/updateshandlers/FlowsUpdatesFilter.kt @@ -14,6 +14,14 @@ class FlowsUpdatesFilter( private val updatesSharedFlow = MutableSharedFlow(extraBufferCapacity = broadcastChannelsSize) @Suppress("MemberVisibilityCanBePrivate") val allUpdatesFlow: Flow = updatesSharedFlow.asSharedFlow() + @Suppress("MemberVisibilityCanBePrivate") + val allUpdatesWithoutMediaGroupsGroupingFlow: Flow = updatesSharedFlow.flatMapConcat { + (if (it is SentMediaGroupUpdate) { + it.origins + } else { + listOf(it) + }).asFlow() + } override val allowedUpdates: List get() = ALL_UPDATES_LIST