1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-01 23:45:25 +00:00
tgbotapi/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/RequestError.kt
2019-12-03 11:07:25 +06:00

21 lines
442 B
Kotlin

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