mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-12-21 21:55:41 +00:00
add GetUpdatesConflict
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user