1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-08 09:23:47 +00:00

Delay after executing action in sendActionDSL

This commit is contained in:
Michael Rittmeister 2024-08-12 23:46:53 +02:00 committed by GitHub
parent 40c5af4469
commit 21ba1cca30
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,10 +24,10 @@ public suspend fun <T> TelegramBot.withAction(
}
val botActionJob = CoroutineScope(currentCoroutineContext()).launch {
while (isActive) {
delay(refreshTime)
safelyWithoutExceptions {
execute(actionRequest)
}
delay(refreshTime)
}
}
val result = safelyWithResult { block() }