1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-03 00:15:27 +00:00
tgbotapi/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/RequestError.kt

21 lines
442 B
Kotlin
Raw Normal View History

2019-02-05 04:51:52 +00:00
package com.github.insanusmokrassar.TelegramBotAPI.types
2019-12-03 05:07:25 +00:00
import com.soywiz.klock.DateTime
2019-02-05 04:51:52 +00:00
sealed class RequestError
data class RetryAfterError(
val seconds: Long,
val startCountingMillis: Long
) : RequestError() {
2019-12-03 05:07:25 +00:00
val canContinue = (seconds * 1000L) + startCountingMillis
val leftToRetry: Long
2019-12-03 05:07:25 +00:00
get() = canContinue - DateTime.nowUnixLong()
2019-02-05 04:51:52 +00:00
}
data class MigrateChatId(
val newChatId: ChatId
) : RequestError()