mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-26 03:58:44 +00:00
FlowsUpdatesFilter#allUpdatesWithoutMediaGroupsGroupingFlow
This commit is contained in:
parent
a28cf5ddff
commit
8b79b15777
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
## 0.30.13
|
## 0.30.13
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* New variable `FlowsUpdatesFilter#allUpdatesWithoutMediaGroupsGroupingFlow` which will contains updates without
|
||||||
|
`SentMediaGroupUpdate`
|
||||||
* `Utils`:
|
* `Utils`:
|
||||||
* Extensions for `ResendableContent` has been added
|
* Extensions for `ResendableContent` has been added
|
||||||
* Extensions for `TextSource` has been added
|
* Extensions for `TextSource` has been added
|
||||||
|
@ -14,6 +14,14 @@ class FlowsUpdatesFilter(
|
|||||||
private val updatesSharedFlow = MutableSharedFlow<Update>(extraBufferCapacity = broadcastChannelsSize)
|
private val updatesSharedFlow = MutableSharedFlow<Update>(extraBufferCapacity = broadcastChannelsSize)
|
||||||
@Suppress("MemberVisibilityCanBePrivate")
|
@Suppress("MemberVisibilityCanBePrivate")
|
||||||
val allUpdatesFlow: Flow<Update> = updatesSharedFlow.asSharedFlow()
|
val allUpdatesFlow: Flow<Update> = updatesSharedFlow.asSharedFlow()
|
||||||
|
@Suppress("MemberVisibilityCanBePrivate")
|
||||||
|
val allUpdatesWithoutMediaGroupsGroupingFlow: Flow<Update> = updatesSharedFlow.flatMapConcat {
|
||||||
|
(if (it is SentMediaGroupUpdate) {
|
||||||
|
it.origins
|
||||||
|
} else {
|
||||||
|
listOf(it)
|
||||||
|
}).asFlow()
|
||||||
|
}
|
||||||
|
|
||||||
override val allowedUpdates: List<String>
|
override val allowedUpdates: List<String>
|
||||||
get() = ALL_UPDATES_LIST
|
get() = ALL_UPDATES_LIST
|
||||||
|
Loading…
Reference in New Issue
Block a user