mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-23 00:57:13 +00:00
fixes
This commit is contained in:
parent
5a456bcdbf
commit
017d57e5e5
@ -55,12 +55,17 @@ fun TelegramBot.longPollingFlow(
|
||||
val updatesHandler: (suspend (List<Update>) -> Unit) = if (mediaGroupsDebounceTimeMillis != null) {
|
||||
val scope = CoroutineScope(contextToWork)
|
||||
val updatesReceiver = scope.updateHandlerWithMediaGroupsAdaptation(
|
||||
::send,
|
||||
{
|
||||
withContext(contextToWork) {
|
||||
send(it)
|
||||
}
|
||||
},
|
||||
mediaGroupsDebounceTimeMillis
|
||||
);
|
||||
{ originalUpdates: List<Update> ->
|
||||
originalUpdates.forEach {
|
||||
updatesReceiver(it)
|
||||
lastUpdateIdentifier = maxOf(lastUpdateIdentifier ?: it.updateId, it.updateId)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user