mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 16:23:48 +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 updatesHandler: (suspend (List<Update>) -> Unit) = if (mediaGroupsDebounceTimeMillis != null) {
|
||||||
val scope = CoroutineScope(contextToWork)
|
val scope = CoroutineScope(contextToWork)
|
||||||
val updatesReceiver = scope.updateHandlerWithMediaGroupsAdaptation(
|
val updatesReceiver = scope.updateHandlerWithMediaGroupsAdaptation(
|
||||||
::send,
|
{
|
||||||
|
withContext(contextToWork) {
|
||||||
|
send(it)
|
||||||
|
}
|
||||||
|
},
|
||||||
mediaGroupsDebounceTimeMillis
|
mediaGroupsDebounceTimeMillis
|
||||||
);
|
);
|
||||||
{ originalUpdates: List<Update> ->
|
{ originalUpdates: List<Update> ->
|
||||||
originalUpdates.forEach {
|
originalUpdates.forEach {
|
||||||
updatesReceiver(it)
|
updatesReceiver(it)
|
||||||
|
lastUpdateIdentifier = maxOf(lastUpdateIdentifier ?: it.updateId, it.updateId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user