mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-02 06:39:41 +00:00
fixes
This commit is contained in:
@@ -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 {
|
||||
|
Reference in New Issue
Block a user