1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-03 00:15:27 +00:00
tgbotapi/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/RequestError.kt
2020-11-11 10:23:20 +06:00

21 lines
420 B
Kotlin

package dev.inmo.tgbotapi.types
import com.soywiz.klock.DateTime
sealed class RequestError
data class RetryAfterError(
val seconds: Seconds,
val startCountingMillis: Long
) : RequestError() {
val canContinue = (seconds * 1000L) + startCountingMillis
val leftToRetry: Long
get() = canContinue - DateTime.nowUnixLong()
}
data class MigrateChatId(
val newChatId: ChatId
) : RequestError()