21 lines
426 B
Kotlin
21 lines
426 B
Kotlin
package dev.inmo.tgbotapi.types
|
|
|
|
import korlibs.time.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: IdChatIdentifier
|
|
) : RequestError()
|
|
|
|
|