1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-12-21 21:55:41 +00:00

add GetUpdatesConflict

This commit is contained in:
2021-06-30 13:57:20 +06:00
parent a241c91adf
commit 75cebf5aa3
3 changed files with 14 additions and 0 deletions

View File

@@ -3,6 +3,7 @@ package dev.inmo.tgbotapi.extensions.utils.updates.retrieving
import dev.inmo.micro_utils.coroutines.*
import dev.inmo.tgbotapi.bot.RequestsExecutor
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.bot.exceptions.GetUpdatesConflict
import dev.inmo.tgbotapi.bot.exceptions.RequestException
import dev.inmo.tgbotapi.extensions.utils.updates.convertWithMediaGroupUpdates
import dev.inmo.tgbotapi.extensions.utils.updates.lastUpdateIdentifier
@@ -31,6 +32,9 @@ fun TelegramBot.longPollingFlow(
if (e is RequestException) {
delay(1000L)
}
if (e is GetUpdatesConflict && (exceptionsHandler == null || exceptionsHandler == defaultSafelyExceptionHandler)) {
println("Warning!!! Other bot with the same bot token requests updates with getUpdate in parallel")
}
}
) {
val updates = execute(