mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-23 00:57:13 +00:00
add opportunity to set up media groups devounce time
This commit is contained in:
parent
1f20ae16aa
commit
ea40474c47
@ -17,12 +17,13 @@ import kotlinx.coroutines.launch
|
||||
* @see UpdateReceiver
|
||||
*/
|
||||
fun CoroutineScope.updateHandlerWithMediaGroupsAdaptation(
|
||||
output: UpdateReceiver<Update>
|
||||
output: UpdateReceiver<Update>,
|
||||
mediaGroupsDebounceMillis: Long = 1000L
|
||||
): UpdateReceiver<Update> {
|
||||
val updatesChannel = Channel<Update>(Channel.UNLIMITED)
|
||||
val mediaGroupChannel = Channel<Pair<String, BaseMessageUpdate>>(Channel.UNLIMITED)
|
||||
val mediaGroupAccumulatedChannel = mediaGroupChannel.accumulateByKey(
|
||||
1000L,
|
||||
mediaGroupsDebounceMillis,
|
||||
scope = this
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user