mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-22 08:13:47 +00:00
commit
009991fa88
16
CHANGELOG.md
16
CHANGELOG.md
@ -1,5 +1,21 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
|
## 8.0.0
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS BREAKING CHANGES**
|
||||||
|
|
||||||
|
**ALL PROJECT DEPRECATIONS HAVE BEEN REMOVED**
|
||||||
|
|
||||||
|
**IN THIS UPDATE KORLIBS HAVE BEEN UPDATED TO VERSION `4.0.2`. SINCE THAT VERSION A LOT OF PACKAGES HAVE BEEN RENAMED.
|
||||||
|
MIGRATIONS USED IN THIS LIB:**
|
||||||
|
|
||||||
|
* `com.soywiz.klock` -> `korlibs.time`
|
||||||
|
* `com.soywiz.krypto` -> `korlibs.crypto`
|
||||||
|
|
||||||
|
* `Versions`:
|
||||||
|
* `Korlibs`: `3.4.0` -> `4.0.3`
|
||||||
|
* `MicroUtils`: `0.18.4` -> `0.19.1`
|
||||||
|
|
||||||
## 7.1.3
|
## 7.1.3
|
||||||
|
|
||||||
* `Versions`:
|
* `Versions`:
|
||||||
|
@ -6,4 +6,4 @@ kotlin.incremental=true
|
|||||||
kotlin.incremental.js=true
|
kotlin.incremental.js=true
|
||||||
|
|
||||||
library_group=dev.inmo
|
library_group=dev.inmo
|
||||||
library_version=7.1.3
|
library_version=8.0.0
|
||||||
|
@ -6,14 +6,14 @@ kotlin-coroutines = "1.6.4"
|
|||||||
|
|
||||||
javax-activation = "1.1.1"
|
javax-activation = "1.1.1"
|
||||||
|
|
||||||
korlibs = "3.4.0"
|
korlibs = "4.0.3"
|
||||||
uuid = "0.7.0"
|
uuid = "0.7.0"
|
||||||
ktor = "2.3.0"
|
ktor = "2.3.0"
|
||||||
|
|
||||||
ksp = "1.8.21-1.0.11"
|
ksp = "1.8.21-1.0.11"
|
||||||
kotlin-poet = "1.13.2"
|
kotlin-poet = "1.14.2"
|
||||||
|
|
||||||
microutils = "0.18.4"
|
microutils = "0.19.1"
|
||||||
|
|
||||||
github-release-plugin = "2.4.1"
|
github-release-plugin = "2.4.1"
|
||||||
dokka = "1.8.10"
|
dokka = "1.8.10"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api
|
package dev.inmo.tgbotapi.extensions.api
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import com.soywiz.klock.TimeSpan
|
import korlibs.time.TimeSpan
|
||||||
import dev.inmo.micro_utils.coroutines.LinkedSupervisorJob
|
import dev.inmo.micro_utils.coroutines.LinkedSupervisorJob
|
||||||
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
|
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
|
||||||
import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup
|
import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.invite_links.CreateChatInviteLink
|
import dev.inmo.tgbotapi.requests.chat.invite_links.CreateChatInviteLink
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||||
import dev.inmo.tgbotapi.requests.chat.invite_links.EditChatInviteLink
|
import dev.inmo.tgbotapi.requests.chat.invite_links.EditChatInviteLink
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||||
|
@ -15,14 +15,3 @@ suspend fun TelegramBot.editMessageMedia(
|
|||||||
media: TelegramMedia,
|
media: TelegramMedia,
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
replyMarkup: InlineKeyboardMarkup? = null
|
||||||
) = execute(EditInlineMessageMedia(inlineMessageId, media, replyMarkup))
|
) = execute(EditInlineMessageMedia(inlineMessageId, media, replyMarkup))
|
||||||
|
|
||||||
/**
|
|
||||||
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
|
|
||||||
* as a builder for that
|
|
||||||
*/
|
|
||||||
@Deprecated("Renamed", ReplaceWith("this.editMessageMedia(inlineMessageId, media, replyMarkup)", "dev.inmo.tgbotapi.extensions.api.edit.media.editMessageMedia"))
|
|
||||||
suspend fun TelegramBot.editMessageCaption(
|
|
||||||
inlineMessageId: InlineMessageIdentifier,
|
|
||||||
media: TelegramMedia,
|
|
||||||
replyMarkup: InlineKeyboardMarkup? = null
|
|
||||||
) = execute(EditInlineMessageMedia(inlineMessageId, media, replyMarkup))
|
|
||||||
|
@ -72,76 +72,3 @@ suspend fun TelegramBot.setStickerSetThumbnail(
|
|||||||
) = setStickerSetThumbnail(
|
) = setStickerSetThumbnail(
|
||||||
user.id, stickerSet.name, thumbnail
|
user.id, stickerSet.name, thumbnail
|
||||||
)
|
)
|
||||||
|
|
||||||
@Deprecated("Renamed in telegram bot api", ReplaceWith("setStickerSetThumbnail(userId, thumbSetName, thumb)", "dev.inmo.tgbotapi.extensions.api.thumbs.setStickerSetThumbnail"))
|
|
||||||
suspend fun TelegramBot.setStickerSetThumb(
|
|
||||||
userId: UserId,
|
|
||||||
thumbSetName: String,
|
|
||||||
thumb: FileId
|
|
||||||
) = execute(
|
|
||||||
SetStickerSetThumbnail(userId, thumbSetName, thumb)
|
|
||||||
)
|
|
||||||
|
|
||||||
@Deprecated("Renamed in telegram bot api", ReplaceWith("setStickerSetThumbnail(userId, thumbSetName, thumb)", "dev.inmo.tgbotapi.extensions.api.thumbs.setStickerSetThumbnail"))
|
|
||||||
suspend fun TelegramBot.setStickerSetThumb(
|
|
||||||
userId: UserId,
|
|
||||||
thumbSetName: String,
|
|
||||||
thumb: MultipartFile
|
|
||||||
) = execute(
|
|
||||||
SetStickerSetThumbnail(userId, thumbSetName, thumb)
|
|
||||||
)
|
|
||||||
|
|
||||||
@Deprecated("Renamed in telegram bot api", ReplaceWith("setStickerSetThumbnail(user, thumbSetName, thumb)", "dev.inmo.tgbotapi.extensions.api.thumbs.setStickerSetThumbnail"))
|
|
||||||
suspend fun TelegramBot.setStickerSetThumb(
|
|
||||||
user: CommonUser,
|
|
||||||
thumbSetName: String,
|
|
||||||
thumb: FileId
|
|
||||||
) = setStickerSetThumb(
|
|
||||||
user.id, thumbSetName, thumb
|
|
||||||
)
|
|
||||||
|
|
||||||
@Deprecated("Renamed in telegram bot api", ReplaceWith("setStickerSetThumbnail(user, thumbSetName, thumb)", "dev.inmo.tgbotapi.extensions.api.thumbs.setStickerSetThumbnail"))
|
|
||||||
suspend fun TelegramBot.setStickerSetThumb(
|
|
||||||
user: CommonUser,
|
|
||||||
thumbSetName: String,
|
|
||||||
thumb: MultipartFile
|
|
||||||
) = setStickerSetThumb(
|
|
||||||
user.id, thumbSetName, thumb
|
|
||||||
)
|
|
||||||
|
|
||||||
@Deprecated("Renamed in telegram bot api", ReplaceWith("setStickerSetThumbnail(userId, thumbSet, thumb)", "dev.inmo.tgbotapi.extensions.api.thumbs.setStickerSetThumbnail"))
|
|
||||||
suspend fun TelegramBot.setStickerSetThumb(
|
|
||||||
userId: UserId,
|
|
||||||
thumbSet: StickerSet,
|
|
||||||
thumb: FileId
|
|
||||||
) = setStickerSetThumb(
|
|
||||||
userId, thumbSet.name, thumb
|
|
||||||
)
|
|
||||||
|
|
||||||
@Deprecated("Renamed in telegram bot api", ReplaceWith("setStickerSetThumbnail(userId, thumbSet, thumb)", "dev.inmo.tgbotapi.extensions.api.thumbs.setStickerSetThumbnail"))
|
|
||||||
suspend fun TelegramBot.setStickerSetThumb(
|
|
||||||
userId: UserId,
|
|
||||||
thumbSet: StickerSet,
|
|
||||||
thumb: MultipartFile
|
|
||||||
) = setStickerSetThumb(
|
|
||||||
userId, thumbSet.name, thumb
|
|
||||||
)
|
|
||||||
|
|
||||||
@Deprecated("Renamed in telegram bot api", ReplaceWith("setStickerSetThumbnail(user, thumbSet, thumb)", "dev.inmo.tgbotapi.extensions.api.thumbs.setStickerSetThumbnail"))
|
|
||||||
suspend fun TelegramBot.setStickerSetThumb(
|
|
||||||
user: CommonUser,
|
|
||||||
thumbSet: StickerSet,
|
|
||||||
thumb: FileId
|
|
||||||
) = setStickerSetThumb(
|
|
||||||
user.id, thumbSet.name, thumb
|
|
||||||
)
|
|
||||||
|
|
||||||
@Deprecated("Renamed in telegram bot api", ReplaceWith("setStickerSetThumbnail(user, thumbSet, thumb)", "dev.inmo.tgbotapi.extensions.api.thumbs.setStickerSetThumbnail"))
|
|
||||||
suspend fun TelegramBot.setStickerSetThumb(
|
|
||||||
user: CommonUser,
|
|
||||||
thumbSet: StickerSet,
|
|
||||||
thumb: MultipartFile
|
|
||||||
) = setStickerSetThumb(
|
|
||||||
user.id, thumbSet.name, thumb
|
|
||||||
)
|
|
||||||
|
|
||||||
|
@ -5,5 +5,3 @@ import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
|||||||
interface WithReplyMarkup {
|
interface WithReplyMarkup {
|
||||||
val replyMarkup: KeyboardMarkup?
|
val replyMarkup: KeyboardMarkup?
|
||||||
}
|
}
|
||||||
@Deprecated("Renamed", ReplaceWith("WithReplyMarkup", "dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup"))
|
|
||||||
typealias ReplyMarkup = WithReplyMarkup
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.bot.exceptions
|
package dev.inmo.tgbotapi.bot.exceptions
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.types.Response
|
import dev.inmo.tgbotapi.types.Response
|
||||||
import dev.inmo.tgbotapi.types.RetryAfterError
|
import dev.inmo.tgbotapi.types.RetryAfterError
|
||||||
import io.ktor.utils.io.errors.IOException
|
import io.ktor.utils.io.errors.IOException
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.bot.settings.limiters
|
package dev.inmo.tgbotapi.bot.settings.limiters
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.types.MilliSeconds
|
import dev.inmo.tgbotapi.types.MilliSeconds
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
import kotlinx.coroutines.sync.Semaphore
|
import kotlinx.coroutines.sync.Semaphore
|
||||||
@ -8,7 +8,7 @@ import kotlinx.serialization.Serializable
|
|||||||
import kotlinx.serialization.Transient
|
import kotlinx.serialization.Transient
|
||||||
import kotlin.math.roundToLong
|
import kotlin.math.roundToLong
|
||||||
|
|
||||||
private fun now(): Long = DateTime.nowUnixLong()
|
private fun now(): Long = DateTime.nowUnixMillisLong()
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
class CommonLimiter(
|
class CommonLimiter(
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.requests.chat.abstracts
|
package dev.inmo.tgbotapi.requests.chat.abstracts
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import kotlinx.serialization.DeserializationStrategy
|
import kotlinx.serialization.DeserializationStrategy
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.requests.chat.invite_links
|
package dev.inmo.tgbotapi.requests.chat.invite_links
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||||
import dev.inmo.tgbotapi.requests.chat.abstracts.*
|
import dev.inmo.tgbotapi.requests.chat.abstracts.*
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.requests.chat.invite_links
|
package dev.inmo.tgbotapi.requests.chat.invite_links
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||||
import dev.inmo.tgbotapi.requests.chat.abstracts.*
|
import dev.inmo.tgbotapi.requests.chat.abstracts.*
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
@ -2,8 +2,4 @@ package dev.inmo.tgbotapi.requests.send.abstracts
|
|||||||
|
|
||||||
interface ThumbedSendMessageRequest<T: Any>: SendMessageRequest<T> {
|
interface ThumbedSendMessageRequest<T: Any>: SendMessageRequest<T> {
|
||||||
val thumbnail: String?
|
val thumbnail: String?
|
||||||
|
|
||||||
@Deprecated("Renamed in telegram bot api", ReplaceWith("thumbnail"))
|
|
||||||
val thumb: String?
|
|
||||||
get() = thumbnail
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.requests.send.polls
|
package dev.inmo.tgbotapi.requests.send.polls
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.abstracts.TextedOutput
|
import dev.inmo.tgbotapi.abstracts.TextedOutput
|
||||||
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||||
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
import dev.inmo.tgbotapi.requests.send.abstracts.SendMessageRequest
|
||||||
|
@ -77,9 +77,6 @@ val UserId.userLink: String
|
|||||||
get() = chatId.userLink
|
get() = chatId.userLink
|
||||||
val User.userLink: String
|
val User.userLink: String
|
||||||
get() = id.userLink
|
get() = id.userLink
|
||||||
@Deprecated("Deprecated due to the conflicts in name", ReplaceWith("this.userLink", "dev.inmo.tgbotapi.types.userLink"))
|
|
||||||
val User.link: String
|
|
||||||
get() = userLink
|
|
||||||
|
|
||||||
typealias UserId = ChatId
|
typealias UserId = ChatId
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.types
|
package dev.inmo.tgbotapi.types
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.abstracts.WithUser
|
import dev.inmo.tgbotapi.abstracts.WithUser
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
|
@ -375,17 +375,9 @@ const val stickerFileIdField = "sticker_file_id"
|
|||||||
const val gameShortNameField = "game_short_name"
|
const val gameShortNameField = "game_short_name"
|
||||||
|
|
||||||
const val thumbnailUrlField = "thumbnail_url"
|
const val thumbnailUrlField = "thumbnail_url"
|
||||||
@Deprecated("Renamed in telegram bot api", ReplaceWith("thumbnailUrlField", "dev.inmo.tgbotapi.types.thumbnailUrlField"))
|
|
||||||
const val thumbUrlField = "thumb_url"
|
|
||||||
const val thumbnailMimeTypeField = "thumbnail_mime_type"
|
const val thumbnailMimeTypeField = "thumbnail_mime_type"
|
||||||
@Deprecated("Renamed in telegram bot api", ReplaceWith("thumbnailMimeTypeField", "dev.inmo.tgbotapi.types.thumbnailMimeTypeField"))
|
|
||||||
const val thumbMimeTypeField = "thumb_mime_type"
|
|
||||||
const val thumbnailWidthField = "thumbnail_width"
|
const val thumbnailWidthField = "thumbnail_width"
|
||||||
@Deprecated("Renamed in telegram bot api", ReplaceWith("thumbnailWidthField", "dev.inmo.tgbotapi.types.thumbnailWidthField"))
|
|
||||||
const val thumbWidthField = "thumb_width"
|
|
||||||
const val thumbnailHeightField = "thumbnail_height"
|
const val thumbnailHeightField = "thumbnail_height"
|
||||||
@Deprecated("Renamed in telegram bot api", ReplaceWith("thumbnailHeightField", "dev.inmo.tgbotapi.types.thumbnailHeightField"))
|
|
||||||
const val thumbHeightField = "thumb_height"
|
|
||||||
|
|
||||||
const val inputMessageContentField = "input_message_content"
|
const val inputMessageContentField = "input_message_content"
|
||||||
const val hideUrlField = "hide_url"
|
const val hideUrlField = "hide_url"
|
||||||
@ -440,8 +432,6 @@ const val idField = "id"
|
|||||||
const val pollIdField = "poll_id"
|
const val pollIdField = "poll_id"
|
||||||
const val textField = "text"
|
const val textField = "text"
|
||||||
const val thumbnailField = "thumbnail"
|
const val thumbnailField = "thumbnail"
|
||||||
@Deprecated("Renamed (in telegram bot api)", ReplaceWith("thumbnailField", "dev.inmo.tgbotapi.types.thumbnailField"))
|
|
||||||
const val thumbField = "thumb"
|
|
||||||
const val emojiField = "emoji"
|
const val emojiField = "emoji"
|
||||||
const val emojisField = "emojis"
|
const val emojisField = "emojis"
|
||||||
const val titleField = "title"
|
const val titleField = "title"
|
||||||
|
@ -2,11 +2,5 @@ package dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts
|
|||||||
|
|
||||||
interface ThumbSizedInlineQueryResult : InlineQueryResult, ThumbedInlineQueryResult {
|
interface ThumbSizedInlineQueryResult : InlineQueryResult, ThumbedInlineQueryResult {
|
||||||
val thumbnailWidth: Int?
|
val thumbnailWidth: Int?
|
||||||
@Deprecated("Renamed in telegram bot api", ReplaceWith("thumbnailWidth"))
|
|
||||||
val thumbWidth: Int?
|
|
||||||
get() = thumbnailWidth
|
|
||||||
val thumbnailHeight: Int?
|
val thumbnailHeight: Int?
|
||||||
@Deprecated("Renamed in telegram bot api", ReplaceWith("thumbnailHeight"))
|
|
||||||
val thumbHeight: Int?
|
|
||||||
get() = thumbnailHeight
|
|
||||||
}
|
}
|
||||||
|
@ -4,14 +4,8 @@ import dev.inmo.tgbotapi.utils.MimeType
|
|||||||
|
|
||||||
interface ThumbedInlineQueryResult : InlineQueryResult {
|
interface ThumbedInlineQueryResult : InlineQueryResult {
|
||||||
val thumbnailUrl: String?
|
val thumbnailUrl: String?
|
||||||
@Deprecated("Renamed in telegram bot api", ReplaceWith("thumbnailUrl"))
|
|
||||||
val thumbUrl: String?
|
|
||||||
get() = thumbnailUrl
|
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ThumbedWithMimeTypeInlineQueryResult : ThumbedInlineQueryResult {
|
interface ThumbedWithMimeTypeInlineQueryResult : ThumbedInlineQueryResult {
|
||||||
val thumbnailMimeType: MimeType?
|
val thumbnailMimeType: MimeType?
|
||||||
@Deprecated("Renamed in telegram bot api", ReplaceWith("thumbnailMimeType"))
|
|
||||||
val thumbMimeType: MimeType?
|
|
||||||
get() = thumbnailMimeType
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.types
|
package dev.inmo.tgbotapi.types
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
|
|
||||||
sealed class RequestError
|
sealed class RequestError
|
||||||
|
|
||||||
@ -10,7 +10,7 @@ data class RetryAfterError(
|
|||||||
) : RequestError() {
|
) : RequestError() {
|
||||||
val canContinue = (seconds * 1000L) + startCountingMillis
|
val canContinue = (seconds * 1000L) + startCountingMillis
|
||||||
val leftToRetry: Long
|
val leftToRetry: Long
|
||||||
get() = canContinue - DateTime.nowUnixLong()
|
get() = canContinue - DateTime.nowUnixMillisLong()
|
||||||
}
|
}
|
||||||
|
|
||||||
data class MigrateChatId(
|
data class MigrateChatId(
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.types
|
package dev.inmo.tgbotapi.types
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.types
|
package dev.inmo.tgbotapi.types
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
import kotlinx.serialization.builtins.serializer
|
import kotlinx.serialization.builtins.serializer
|
||||||
|
@ -14,12 +14,6 @@ const val UPDATE_POLL_ANSWER = "poll_answer"
|
|||||||
const val UPDATE_MY_CHAT_MEMBER = "my_chat_member"
|
const val UPDATE_MY_CHAT_MEMBER = "my_chat_member"
|
||||||
const val UPDATE_CHAT_MEMBER = "chat_member"
|
const val UPDATE_CHAT_MEMBER = "chat_member"
|
||||||
const val UPDATE_CHAT_JOIN_REQUEST = "chat_join_request"
|
const val UPDATE_CHAT_JOIN_REQUEST = "chat_join_request"
|
||||||
@Deprecated("Renamed", ReplaceWith("UPDATE_MY_CHAT_MEMBER", "dev.inmo.tgbotapi.types.UPDATE_MY_CHAT_MEMBER"))
|
|
||||||
const val MY_CHAT_MEMBER = UPDATE_MY_CHAT_MEMBER
|
|
||||||
@Deprecated("Renamed", ReplaceWith("UPDATE_CHAT_MEMBER", "dev.inmo.tgbotapi.types.UPDATE_CHAT_MEMBER"))
|
|
||||||
const val CHAT_MEMBER = UPDATE_CHAT_MEMBER
|
|
||||||
@Deprecated("Renamed", ReplaceWith("UPDATE_CHAT_JOIN_REQUEST", "dev.inmo.tgbotapi.types.UPDATE_CHAT_JOIN_REQUEST"))
|
|
||||||
const val CHAT_JOIN_REQUEST = UPDATE_CHAT_JOIN_REQUEST
|
|
||||||
|
|
||||||
val ALL_UPDATES_LIST = listOf(
|
val ALL_UPDATES_LIST = listOf(
|
||||||
UPDATE_MESSAGE,
|
UPDATE_MESSAGE,
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.types.chat
|
package dev.inmo.tgbotapi.types.chat
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.abstracts.FromUser
|
import dev.inmo.tgbotapi.abstracts.FromUser
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
|
@ -2,8 +2,4 @@ package dev.inmo.tgbotapi.types.files
|
|||||||
|
|
||||||
sealed interface ThumbedMediaFile : TelegramMediaFile {
|
sealed interface ThumbedMediaFile : TelegramMediaFile {
|
||||||
val thumbnail: PhotoSize?
|
val thumbnail: PhotoSize?
|
||||||
|
|
||||||
@Deprecated("Renamed (in telegram bot api)", ReplaceWith("thumbnail"))
|
|
||||||
val thumb: PhotoSize?
|
|
||||||
get() = thumbnail
|
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.types.message
|
package dev.inmo.tgbotapi.types.message
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.ChannelChat
|
import dev.inmo.tgbotapi.types.chat.ChannelChat
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.types.message
|
package dev.inmo.tgbotapi.types.message
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.chat.ChannelChat
|
import dev.inmo.tgbotapi.types.chat.ChannelChat
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelEvent
|
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.ChannelEvent
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package dev.inmo.tgbotapi.types.message.ChatEvents.voice
|
package dev.inmo.tgbotapi.types.message.ChatEvents.voice
|
||||||
|
|
||||||
import com.soywiz.klock.TimeSpan
|
import korlibs.time.TimeSpan
|
||||||
import com.soywiz.klock.seconds
|
import korlibs.time.seconds
|
||||||
import dev.inmo.tgbotapi.types.Seconds
|
import dev.inmo.tgbotapi.types.Seconds
|
||||||
import dev.inmo.tgbotapi.types.durationField
|
import dev.inmo.tgbotapi.types.durationField
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.VideoChatEvent
|
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.VideoChatEvent
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.types.message
|
package dev.inmo.tgbotapi.types.message
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
import dev.inmo.tgbotapi.types.chat.GroupChat
|
import dev.inmo.tgbotapi.types.chat.GroupChat
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.types.message
|
package dev.inmo.tgbotapi.types.message
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
import dev.inmo.tgbotapi.types.chat.SupergroupChat
|
import dev.inmo.tgbotapi.types.chat.SupergroupChat
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.types.message
|
package dev.inmo.tgbotapi.types.message
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.*
|
import dev.inmo.tgbotapi.types.chat.*
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.types.message
|
package dev.inmo.tgbotapi.types.message
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.chat.User
|
import dev.inmo.tgbotapi.types.chat.User
|
||||||
import dev.inmo.tgbotapi.types.chat.Chat
|
import dev.inmo.tgbotapi.types.chat.Chat
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.types.message
|
package dev.inmo.tgbotapi.types.message
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
|
||||||
import dev.inmo.tgbotapi.types.chat.*
|
import dev.inmo.tgbotapi.types.chat.*
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.types.message
|
package dev.inmo.tgbotapi.types.message
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
import dev.inmo.tgbotapi.types.chat.PrivateChat
|
import dev.inmo.tgbotapi.types.chat.PrivateChat
|
||||||
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateEvent
|
import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateEvent
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.types.message.abstracts
|
package dev.inmo.tgbotapi.types.message.abstracts
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.abstracts.WithChat
|
import dev.inmo.tgbotapi.abstracts.WithChat
|
||||||
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
|
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.MessageId
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package dev.inmo.tgbotapi.types.message.abstracts
|
package dev.inmo.tgbotapi.types.message.abstracts
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
|
|
||||||
interface PossiblyEditedMessage : Message {
|
interface PossiblyEditedMessage : Message {
|
||||||
val editDate: DateTime?
|
val editDate: DateTime?
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package dev.inmo.tgbotapi.types.polls
|
package dev.inmo.tgbotapi.types.polls
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import com.soywiz.klock.TimeSpan
|
import korlibs.time.TimeSpan
|
||||||
import dev.inmo.tgbotapi.abstracts.TextedInput
|
import dev.inmo.tgbotapi.abstracts.TextedInput
|
||||||
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
|
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
@ -32,9 +32,6 @@ sealed interface StickerSet {
|
|||||||
val isVideo: Boolean
|
val isVideo: Boolean
|
||||||
get() = false
|
get() = false
|
||||||
val thumbnail: PhotoSize?
|
val thumbnail: PhotoSize?
|
||||||
@Deprecated("Renamed in telegram bot api")
|
|
||||||
val thumb: PhotoSize?
|
|
||||||
get() = thumbnail
|
|
||||||
|
|
||||||
object Serializer : KSerializer<StickerSet> {
|
object Serializer : KSerializer<StickerSet> {
|
||||||
override val descriptor: SerialDescriptor = JsonElement.serializer().descriptor
|
override val descriptor: SerialDescriptor = JsonElement.serializer().descriptor
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
package dev.inmo.tgbotapi.utils
|
package dev.inmo.tgbotapi.utils
|
||||||
|
|
||||||
import com.soywiz.krypto.*
|
import korlibs.crypto.*
|
||||||
import io.ktor.http.decodeURLQueryComponent
|
import io.ktor.http.decodeURLQueryComponent
|
||||||
import io.ktor.utils.io.core.toByteArray
|
import io.ktor.utils.io.core.toByteArray
|
||||||
|
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
package dev.inmo.tgbotapi.types
|
package dev.inmo.tgbotapi.types
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import dev.inmo.tgbotapi.TestsJsonFormat
|
import dev.inmo.tgbotapi.TestsJsonFormat
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlin.test.Test
|
import kotlin.test.Test
|
||||||
import kotlin.test.assertEquals
|
import kotlin.test.assertEquals
|
||||||
|
|
||||||
private val dateTimeUnix = DateTime.nowUnixLong()
|
private val dateTimeUnix = DateTime.nowUnixMillisLong()
|
||||||
private val dateTimeMillis = dateTimeUnix * 1000
|
private val dateTimeMillis = dateTimeUnix * 1000
|
||||||
private val dateTime = DateTime(dateTimeMillis)
|
private val dateTime = DateTime(dateTimeMillis)
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package dev.inmo.tgbotapi.extensions.utils.shortcuts
|
package dev.inmo.tgbotapi.extensions.utils.shortcuts
|
||||||
|
|
||||||
import com.soywiz.klock.DateTime
|
import korlibs.time.DateTime
|
||||||
import com.soywiz.klock.TimeSpan
|
import korlibs.time.TimeSpan
|
||||||
import dev.inmo.tgbotapi.types.LongSeconds
|
import dev.inmo.tgbotapi.types.LongSeconds
|
||||||
import dev.inmo.tgbotapi.types.Seconds
|
import dev.inmo.tgbotapi.types.Seconds
|
||||||
import dev.inmo.tgbotapi.types.polls.ApproximateScheduledCloseInfo
|
import dev.inmo.tgbotapi.types.polls.ApproximateScheduledCloseInfo
|
||||||
|
Loading…
Reference in New Issue
Block a user