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
|
2019-02-05 04:55:46 +00:00
|
|
|
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()
|
|
|
|
|
|
|
|
|