mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-06-01 15:35:24 +00:00
21 lines
467 B
Kotlin
21 lines
467 B
Kotlin
package com.github.insanusmokrassar.TelegramBotAPI.types
|
|
|
|
import java.util.concurrent.TimeUnit
|
|
|
|
sealed class RequestError
|
|
|
|
data class RetryAfterError(
|
|
val seconds: Long,
|
|
val startCountingMillis: Long
|
|
) : RequestError() {
|
|
val canContinue = TimeUnit.SECONDS.toMillis(seconds) + startCountingMillis
|
|
val leftToRetry: Long
|
|
get() = canContinue - System.currentTimeMillis()
|
|
}
|
|
|
|
data class MigrateChatId(
|
|
val newChatId: ChatId
|
|
) : RequestError()
|
|
|
|
|