From 51c7c376d75a486243a23c4561b1d7f988664fef Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 28 May 2023 20:39:46 +0600 Subject: [PATCH] all previous deprecations have been removed --- CHANGELOG.md | 2 + .../api/edit/media/EditInlineMessageMedia.kt | 11 --- .../api/stickers/SetStickerSetThumb.kt | 73 ------------------- .../abstracts/types/WithReplyMarkup.kt | 2 - .../abstracts/ThumbedSendMessageRequest.kt | 4 - .../dev/inmo/tgbotapi/types/ChatIdentifier.kt | 3 - .../kotlin/dev/inmo/tgbotapi/types/Common.kt | 10 --- .../abstracts/ThumbSizedInlineQueryResult.kt | 6 -- .../abstracts/ThumbedInlineQueryResult.kt | 6 -- .../dev/inmo/tgbotapi/types/UpdateTypes.kt | 6 -- .../tgbotapi/types/files/ThumbedMediaFile.kt | 4 - .../tgbotapi/types/stickers/StickerSet.kt | 3 - 12 files changed, 2 insertions(+), 128 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 530bcceb7c..e087c3f191 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,8 @@ **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:** diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/media/EditInlineMessageMedia.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/media/EditInlineMessageMedia.kt index 20c6c9679a..6225af2927 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/media/EditInlineMessageMedia.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/edit/media/EditInlineMessageMedia.kt @@ -15,14 +15,3 @@ suspend fun TelegramBot.editMessageMedia( media: TelegramMedia, replyMarkup: InlineKeyboardMarkup? = null ) = 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)) diff --git a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerSetThumb.kt b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerSetThumb.kt index d38f7ed4f3..c89a7efc72 100644 --- a/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerSetThumb.kt +++ b/tgbotapi.api/src/commonMain/kotlin/dev/inmo/tgbotapi/extensions/api/stickers/SetStickerSetThumb.kt @@ -72,76 +72,3 @@ suspend fun TelegramBot.setStickerSetThumbnail( ) = setStickerSetThumbnail( 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 -) - diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/WithReplyMarkup.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/WithReplyMarkup.kt index 3429d822c8..21ab7de502 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/WithReplyMarkup.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/abstracts/types/WithReplyMarkup.kt @@ -5,5 +5,3 @@ import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup interface WithReplyMarkup { val replyMarkup: KeyboardMarkup? } -@Deprecated("Renamed", ReplaceWith("WithReplyMarkup", "dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup")) -typealias ReplyMarkup = WithReplyMarkup diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/abstracts/ThumbedSendMessageRequest.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/abstracts/ThumbedSendMessageRequest.kt index 97cedd3095..8ba2bfafb2 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/abstracts/ThumbedSendMessageRequest.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/send/abstracts/ThumbedSendMessageRequest.kt @@ -2,8 +2,4 @@ package dev.inmo.tgbotapi.requests.send.abstracts interface ThumbedSendMessageRequest: SendMessageRequest { val thumbnail: String? - - @Deprecated("Renamed in telegram bot api", ReplaceWith("thumbnail")) - val thumb: String? - get() = thumbnail } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatIdentifier.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatIdentifier.kt index b870ad90ff..96881e086b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatIdentifier.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ChatIdentifier.kt @@ -77,9 +77,6 @@ val UserId.userLink: String get() = chatId.userLink val User.userLink: String 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 diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index ebcbf22d6c..95023b91a9 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -375,17 +375,9 @@ const val stickerFileIdField = "sticker_file_id" const val gameShortNameField = "game_short_name" 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" -@Deprecated("Renamed in telegram bot api", ReplaceWith("thumbnailMimeTypeField", "dev.inmo.tgbotapi.types.thumbnailMimeTypeField")) -const val thumbMimeTypeField = "thumb_mime_type" 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" -@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 hideUrlField = "hide_url" @@ -440,8 +432,6 @@ const val idField = "id" const val pollIdField = "poll_id" const val textField = "text" 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 emojisField = "emojis" const val titleField = "title" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/ThumbSizedInlineQueryResult.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/ThumbSizedInlineQueryResult.kt index a8c110da8d..4216670849 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/ThumbSizedInlineQueryResult.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/ThumbSizedInlineQueryResult.kt @@ -2,11 +2,5 @@ package dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts interface ThumbSizedInlineQueryResult : InlineQueryResult, ThumbedInlineQueryResult { val thumbnailWidth: Int? - @Deprecated("Renamed in telegram bot api", ReplaceWith("thumbnailWidth")) - val thumbWidth: Int? - get() = thumbnailWidth val thumbnailHeight: Int? - @Deprecated("Renamed in telegram bot api", ReplaceWith("thumbnailHeight")) - val thumbHeight: Int? - get() = thumbnailHeight } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/ThumbedInlineQueryResult.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/ThumbedInlineQueryResult.kt index d2e9895351..799d195bc0 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/ThumbedInlineQueryResult.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/abstracts/ThumbedInlineQueryResult.kt @@ -4,14 +4,8 @@ import dev.inmo.tgbotapi.utils.MimeType interface ThumbedInlineQueryResult : InlineQueryResult { val thumbnailUrl: String? - @Deprecated("Renamed in telegram bot api", ReplaceWith("thumbnailUrl")) - val thumbUrl: String? - get() = thumbnailUrl } interface ThumbedWithMimeTypeInlineQueryResult : ThumbedInlineQueryResult { val thumbnailMimeType: MimeType? - @Deprecated("Renamed in telegram bot api", ReplaceWith("thumbnailMimeType")) - val thumbMimeType: MimeType? - get() = thumbnailMimeType } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/UpdateTypes.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/UpdateTypes.kt index 11e84ff625..2aa6dc43e8 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/UpdateTypes.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/UpdateTypes.kt @@ -14,12 +14,6 @@ const val UPDATE_POLL_ANSWER = "poll_answer" const val UPDATE_MY_CHAT_MEMBER = "my_chat_member" const val UPDATE_CHAT_MEMBER = "chat_member" 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( UPDATE_MESSAGE, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/ThumbedMediaFile.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/ThumbedMediaFile.kt index 456519d3bb..e7eb3d388b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/ThumbedMediaFile.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/ThumbedMediaFile.kt @@ -2,8 +2,4 @@ package dev.inmo.tgbotapi.types.files sealed interface ThumbedMediaFile : TelegramMediaFile { val thumbnail: PhotoSize? - - @Deprecated("Renamed (in telegram bot api)", ReplaceWith("thumbnail")) - val thumb: PhotoSize? - get() = thumbnail } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/stickers/StickerSet.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/stickers/StickerSet.kt index 4f80e71d49..b11a33475d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/stickers/StickerSet.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/stickers/StickerSet.kt @@ -32,9 +32,6 @@ sealed interface StickerSet { val isVideo: Boolean get() = false val thumbnail: PhotoSize? - @Deprecated("Renamed in telegram bot api") - val thumb: PhotoSize? - get() = thumbnail object Serializer : KSerializer { override val descriptor: SerialDescriptor = JsonElement.serializer().descriptor