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

Merge pull request #883 from DRSchlaubi/patch-1

Delay after executing action in sendActionDSL
This commit is contained in:
InsanusMokrassar 2024-08-15 00:31:19 +06:00 committed by GitHub
commit 1990e6b158
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 { val botActionJob = CoroutineScope(currentCoroutineContext()).launch {
while (isActive) { while (isActive) {
delay(refreshTime)
safelyWithoutExceptions { safelyWithoutExceptions {
execute(actionRequest) execute(actionRequest)
} }
delay(refreshTime)
} }
} }
val result = safelyWithResult { block() } val result = safelyWithResult { block() }