From 90b9c66beaf3b732724b1cd0f8ddf73f9e9c84ce Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Fri, 10 Mar 2023 12:24:12 +0600 Subject: [PATCH] rename all thumb* usages --- .../kotlin/dev/inmo/tgbotapi/types/Common.kt | 8 ++++ .../InlineQueryResultArticle.kt | 12 +++--- .../InlineQueryResultContact.kt | 12 +++--- .../InlineQueryResultDocumentImpl.kt | 32 ++++++++-------- .../InlineQueryResultGifImpl.kt | 38 +++++++++---------- .../InlineQueryResultLocation.kt | 12 +++--- .../InlineQueryResultMpeg4GifImpl.kt | 26 ++++++------- .../InlineQueryResultPhotoImpl.kt | 12 +++--- .../InlineQueryResultVenue.kt | 12 +++--- .../InlineQueryResultVideoImpl.kt | 12 +++--- .../abstracts/ThumbSizedInlineQueryResult.kt | 8 +++- .../abstracts/ThumbedInlineQueryResult.kt | 8 +++- 12 files changed, 106 insertions(+), 86 deletions(-) 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 be3c2992b3..cb3abb8999 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 @@ -332,9 +332,17 @@ 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" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultArticle.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultArticle.kt index 870e3e7fc8..efdf2b08a4 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultArticle.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultArticle.kt @@ -23,12 +23,12 @@ class InlineQueryResultArticle( val hideUrl: Boolean? = null, @SerialName(descriptionField) override val description: String? = null, - @SerialName(thumbUrlField) - override val thumbUrl: String? = null, - @SerialName(thumbWidthField) - override val thumbWidth: Int? = null, - @SerialName(thumbHeightField) - override val thumbHeight: Int? = null + @SerialName(thumbnailUrlField) + override val thumbnailUrl: String? = null, + @SerialName(thumbnailWidthField) + override val thumbnailWidth: Int? = null, + @SerialName(thumbnailHeightField) + override val thumbnailHeight: Int? = null ) : InlineQueryResult, ThumbSizedInlineQueryResult, TitledInlineQueryResult, diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultContact.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultContact.kt index 25ee6f4c9a..5b15d28ad9 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultContact.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultContact.kt @@ -20,12 +20,12 @@ data class InlineQueryResultContact( override val lastName: String? = null, @SerialName(vcardField) override val vcard: String? = null, - @SerialName(thumbUrlField) - override val thumbUrl: String? = null, - @SerialName(thumbWidthField) - override val thumbWidth: Int? = null, - @SerialName(thumbHeightField) - override val thumbHeight: Int? = null, + @SerialName(thumbnailUrlField) + override val thumbnailUrl: String? = null, + @SerialName(thumbnailWidthField) + override val thumbnailWidth: Int? = null, + @SerialName(thumbnailHeightField) + override val thumbnailHeight: Int? = null, @SerialName(replyMarkupField) override val replyMarkup: InlineKeyboardMarkup? = null, @SerialName(inputMessageContentField) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt index ea2d06a3cb..f7ce408e89 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultDocumentImpl.kt @@ -21,24 +21,24 @@ fun InlineQueryResultDocumentImpl( url: String, title: String, mimeType: MimeType, - thumbUrl: String? = null, - thumbWidth: Int? = null, - thumbHeight: Int? = null, + thumbnailUrl: String? = null, + thumbnailWidth: Int? = null, + thumbnailHeight: Int? = null, description: String? = null, text: String? = null, parseMode: ParseMode? = null, replyMarkup: InlineKeyboardMarkup? = null, inputMessageContent: InputMessageContent? = null -) = InlineQueryResultDocumentImpl(id, url, title, mimeType, thumbUrl, thumbWidth, thumbHeight, description, text, parseMode, null, replyMarkup, inputMessageContent) +) = InlineQueryResultDocumentImpl(id, url, title, mimeType, thumbnailUrl, thumbnailWidth, thumbnailHeight, description, text, parseMode, null, replyMarkup, inputMessageContent) fun InlineQueryResultDocumentImpl( id: InlineQueryIdentifier, url: String, title: String, mimeType: MimeType, - thumbUrl: String? = null, - thumbWidth: Int? = null, - thumbHeight: Int? = null, + thumbnailUrl: String? = null, + thumbnailWidth: Int? = null, + thumbnailHeight: Int? = null, description: String? = null, entities: TextSourcesList, replyMarkup: InlineKeyboardMarkup? = null, @@ -48,9 +48,9 @@ fun InlineQueryResultDocumentImpl( url, title, mimeType, - thumbUrl, - thumbWidth, - thumbHeight, + thumbnailUrl, + thumbnailWidth, + thumbnailHeight, description, entities.makeString(), null, @@ -69,12 +69,12 @@ data class InlineQueryResultDocumentImpl internal constructor( override val title: String, @SerialName(mimeTypeField) override val mimeType: MimeType, - @SerialName(thumbUrlField) - override val thumbUrl: String? = null, - @SerialName(thumbWidthField) - override val thumbWidth: Int? = null, - @SerialName(thumbHeightField) - override val thumbHeight: Int? = null, + @SerialName(thumbnailUrlField) + override val thumbnailUrl: String? = null, + @SerialName(thumbnailWidthField) + override val thumbnailWidth: Int? = null, + @SerialName(thumbnailHeightField) + override val thumbnailHeight: Int? = null, @SerialName(descriptionField) override val description: String? = null, @SerialName(captionField) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt index 7945ea13f2..8142ead6de 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultGifImpl.kt @@ -20,8 +20,8 @@ import kotlinx.serialization.Serializable fun InlineQueryResultGifImpl( id: InlineQueryIdentifier, url: String, - thumbUrl: String, - thumbMimeType: MimeType? = null, + thumbnailUrl: String, + thumbnailMimeType: MimeType? = null, width: Int? = null, height: Int? = null, duration: Int? = null, @@ -30,13 +30,13 @@ fun InlineQueryResultGifImpl( parseMode: ParseMode? = null, replyMarkup: InlineKeyboardMarkup? = null, inputMessageContent: InputMessageContent? = null -) = InlineQueryResultGifImpl(id, url, thumbUrl, thumbMimeType, width, height, duration, title, text, parseMode, null, replyMarkup, inputMessageContent) +) = InlineQueryResultGifImpl(id, url, thumbnailUrl, thumbnailMimeType, width, height, duration, title, text, parseMode, null, replyMarkup, inputMessageContent) fun InlineQueryResultGifImpl( id: InlineQueryIdentifier, url: String, - thumbUrl: String, - thumbMimeType: MimeType? = null, + thumbnailUrl: String, + thumbnailMimeType: MimeType? = null, width: Int? = null, height: Int? = null, duration: Int? = null, @@ -47,8 +47,8 @@ fun InlineQueryResultGifImpl( ) = InlineQueryResultGifImpl( id, url, - thumbUrl, - thumbMimeType, + thumbnailUrl, + thumbnailMimeType, width, height, duration, @@ -63,8 +63,8 @@ fun InlineQueryResultGifImpl( fun InlineQueryResultGifImpl( id: InlineQueryIdentifier, gifFile: FileId, - thumbUrl: String, - thumbMimeType: MimeType? = null, + thumbnailUrl: String, + thumbnailMimeType: MimeType? = null, width: Int? = null, height: Int? = null, duration: Int? = null, @@ -73,13 +73,13 @@ fun InlineQueryResultGifImpl( parseMode: ParseMode? = null, replyMarkup: InlineKeyboardMarkup? = null, inputMessageContent: InputMessageContent? = null -) = InlineQueryResultGifImpl(id, gifFile.fileId, thumbUrl, thumbMimeType, width, height, duration, title, text, parseMode, replyMarkup, inputMessageContent) +) = InlineQueryResultGifImpl(id, gifFile.fileId, thumbnailUrl, thumbnailMimeType, width, height, duration, title, text, parseMode, replyMarkup, inputMessageContent) fun InlineQueryResultGifImpl( id: InlineQueryIdentifier, gifFile: FileId, - thumbUrl: String, - thumbMimeType: MimeType? = null, + thumbnailUrl: String, + thumbnailMimeType: MimeType? = null, width: Int? = null, height: Int? = null, duration: Int? = null, @@ -88,7 +88,7 @@ fun InlineQueryResultGifImpl( replyMarkup: InlineKeyboardMarkup? = null, inputMessageContent: InputMessageContent? = null ) = InlineQueryResultGifImpl( - id, gifFile.fileId, thumbUrl, thumbMimeType, width, height, duration, title, entities, replyMarkup, inputMessageContent + id, gifFile.fileId, thumbnailUrl, thumbnailMimeType, width, height, duration, title, entities, replyMarkup, inputMessageContent ) @Serializable @@ -97,10 +97,10 @@ data class InlineQueryResultGifImpl internal constructor( override val id: InlineQueryIdentifier, @SerialName(gifUrlField) override val url: String, - @SerialName(thumbUrlField) - override val thumbUrl: String, - @SerialName(thumbMimeTypeField) - override val thumbMimeType: MimeType? = null, + @SerialName(thumbnailUrlField) + override val thumbnailUrl: String, + @SerialName(thumbnailMimeTypeField) + override val thumbnailMimeType: MimeType? = null, @SerialName(gifWidthField) override val width: Int? = null, @SerialName(gifHeightField) @@ -126,8 +126,8 @@ data class InlineQueryResultGifImpl internal constructor( } init { - if (thumbMimeType != null && thumbMimeType !in telegramInlineModeGifPermittedMimeTypes) { - error("Passed thumb mime type is not permitted in Telegram Bot API. Passed $thumbMimeType, but permitted $telegramInlineModeGifPermittedMimeTypes") + if (thumbnailMimeType != null && thumbnailMimeType !in telegramInlineModeGifPermittedMimeTypes) { + error("Passed thumb mime type is not permitted in Telegram Bot API. Passed $thumbnailMimeType, but permitted $telegramInlineModeGifPermittedMimeTypes") } } } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt index cd1426d15b..1fa53ddb7a 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultLocation.kt @@ -26,12 +26,12 @@ data class InlineQueryResultLocation( override val heading: Degrees? = null, @SerialName(proximityAlertRadiusField) override val proximityAlertRadius: Meters? = null, - @SerialName(thumbUrlField) - override val thumbUrl: String? = null, - @SerialName(thumbWidthField) - override val thumbWidth: Int? = null, - @SerialName(thumbHeightField) - override val thumbHeight: Int? = null, + @SerialName(thumbnailUrlField) + override val thumbnailUrl: String? = null, + @SerialName(thumbnailWidthField) + override val thumbnailWidth: Int? = null, + @SerialName(thumbnailHeightField) + override val thumbnailHeight: Int? = null, @SerialName(replyMarkupField) override val replyMarkup: InlineKeyboardMarkup? = null, @SerialName(inputMessageContentField) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt index bda5d0b884..50b69a3ac1 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt @@ -19,8 +19,8 @@ import kotlinx.serialization.Serializable fun InlineQueryResultMpeg4GifImpl( id: InlineQueryIdentifier, url: String, - thumbUrl: String, - thumbMimeType: MimeType? = null, + thumbnailUrl: String, + thumbnailMimeType: MimeType? = null, width: Int? = null, height: Int? = null, duration: Int? = null, @@ -29,13 +29,13 @@ fun InlineQueryResultMpeg4GifImpl( parseMode: ParseMode? = null, replyMarkup: InlineKeyboardMarkup? = null, inputMessageContent: InputMessageContent? = null -) = InlineQueryResultMpeg4GifImpl(id, url, thumbUrl, thumbMimeType, width, height, duration, title, text, parseMode, null, replyMarkup, inputMessageContent) +) = InlineQueryResultMpeg4GifImpl(id, url, thumbnailUrl, thumbnailMimeType, width, height, duration, title, text, parseMode, null, replyMarkup, inputMessageContent) fun InlineQueryResultMpeg4GifImpl( id: InlineQueryIdentifier, url: String, - thumbUrl: String, - thumbMimeType: MimeType? = null, + thumbnailUrl: String, + thumbnailMimeType: MimeType? = null, width: Int? = null, height: Int? = null, duration: Int? = null, @@ -46,8 +46,8 @@ fun InlineQueryResultMpeg4GifImpl( ) = InlineQueryResultMpeg4GifImpl( id, url, - thumbUrl, - thumbMimeType, + thumbnailUrl, + thumbnailMimeType, width, height, duration, @@ -65,10 +65,10 @@ data class InlineQueryResultMpeg4GifImpl internal constructor( override val id: InlineQueryIdentifier, @SerialName(mpeg4GifUrlField) override val url: String, - @SerialName(thumbUrlField) - override val thumbUrl: String, - @SerialName(thumbMimeTypeField) - override val thumbMimeType: MimeType? = null, + @SerialName(thumbnailUrlField) + override val thumbnailUrl: String, + @SerialName(thumbnailMimeTypeField) + override val thumbnailMimeType: MimeType? = null, @SerialName(mpeg4GifWidthField) override val width: Int? = null, @SerialName(mpeg4GifHeightField) @@ -94,8 +94,8 @@ data class InlineQueryResultMpeg4GifImpl internal constructor( } init { - if (thumbMimeType != null && thumbMimeType !in telegramInlineModeGifPermittedMimeTypes) { - error("Passed thumb mime type is not permitted in Telegram Bot API. Passed $thumbMimeType, but permitted $telegramInlineModeGifPermittedMimeTypes") + if (thumbnailMimeType != null && thumbnailMimeType !in telegramInlineModeGifPermittedMimeTypes) { + error("Passed thumb mime type is not permitted in Telegram Bot API. Passed $thumbnailMimeType, but permitted $telegramInlineModeGifPermittedMimeTypes") } } } diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoImpl.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoImpl.kt index 905a51f47d..13a40dccc5 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoImpl.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultPhotoImpl.kt @@ -18,7 +18,7 @@ import kotlinx.serialization.Serializable fun InlineQueryResultPhotoImpl( id: InlineQueryIdentifier, url: String, - thumbUrl: String, + thumbnailUrl: String, width: Int? = null, height: Int? = null, title: String? = null, @@ -27,12 +27,12 @@ fun InlineQueryResultPhotoImpl( parseMode: ParseMode? = null, replyMarkup: InlineKeyboardMarkup? = null, inputMessageContent: InputMessageContent? = null -) = InlineQueryResultPhotoImpl(id, url, thumbUrl, width, height, title, description, text, parseMode, null, replyMarkup, inputMessageContent) +) = InlineQueryResultPhotoImpl(id, url, thumbnailUrl, width, height, title, description, text, parseMode, null, replyMarkup, inputMessageContent) fun InlineQueryResultPhotoImpl( id: InlineQueryIdentifier, url: String, - thumbUrl: String, + thumbnailUrl: String, width: Int? = null, height: Int? = null, title: String? = null, @@ -43,7 +43,7 @@ fun InlineQueryResultPhotoImpl( ) = InlineQueryResultPhotoImpl( id, url, - thumbUrl, + thumbnailUrl, width, height, title, @@ -61,8 +61,8 @@ data class InlineQueryResultPhotoImpl internal constructor( override val id: InlineQueryIdentifier, @SerialName(photoUrlField) override val url: String, - @SerialName(thumbUrlField) - override val thumbUrl: String, + @SerialName(thumbnailUrlField) + override val thumbnailUrl: String, @SerialName(photoWidthField) override val width: Int? = null, @SerialName(photoHeightField) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultVenue.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultVenue.kt index afd4b6ac3f..da1949d9c7 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultVenue.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultVenue.kt @@ -29,12 +29,12 @@ data class InlineQueryResultVenue( override val googlePlaceId: GooglePlaceId? = null, @SerialName(googlePlaceTypeField) override val googlePlaceType: GooglePlaceType? = null, - @SerialName(thumbUrlField) - override val thumbUrl: String? = null, - @SerialName(thumbWidthField) - override val thumbWidth: Int? = null, - @SerialName(thumbHeightField) - override val thumbHeight: Int? = null, + @SerialName(thumbnailUrlField) + override val thumbnailUrl: String? = null, + @SerialName(thumbnailWidthField) + override val thumbnailWidth: Int? = null, + @SerialName(thumbnailHeightField) + override val thumbnailHeight: Int? = null, @SerialName(replyMarkupField) override val replyMarkup: InlineKeyboardMarkup? = null, @SerialName(inputMessageContentField) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt index c711860c18..31ce8a7e50 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/InlineQueryResult/InlineQueryResultVideoImpl.kt @@ -19,7 +19,7 @@ import kotlinx.serialization.Serializable fun InlineQueryResultVideoImpl( id: InlineQueryIdentifier, url: String, - thumbUrl: String, + thumbnailUrl: String, mimeType: MimeType, title: String, width: Int? = null, @@ -30,12 +30,12 @@ fun InlineQueryResultVideoImpl( parseMode: ParseMode? = null, replyMarkup: InlineKeyboardMarkup? = null, inputMessageContent: InputMessageContent? = null -) = InlineQueryResultVideoImpl(id, url, thumbUrl, mimeType, title, width, height, duration, description, text, parseMode, null, replyMarkup, inputMessageContent) +) = InlineQueryResultVideoImpl(id, url, thumbnailUrl, mimeType, title, width, height, duration, description, text, parseMode, null, replyMarkup, inputMessageContent) fun InlineQueryResultVideoImpl( id: InlineQueryIdentifier, url: String, - thumbUrl: String, + thumbnailUrl: String, mimeType: MimeType, title: String, width: Int? = null, @@ -48,7 +48,7 @@ fun InlineQueryResultVideoImpl( ) = InlineQueryResultVideoImpl( id, url, - thumbUrl, + thumbnailUrl, mimeType, title, width, @@ -68,8 +68,8 @@ data class InlineQueryResultVideoImpl internal constructor( override val id: InlineQueryIdentifier, @SerialName(videoUrlField) override val url: String, - @SerialName(thumbUrlField) - override val thumbUrl: String, + @SerialName(thumbnailUrlField) + override val thumbnailUrl: String, @SerialName(mimeTypeField) override val mimeType: MimeType, @SerialName(titleField) 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 ed49bc5b70..a8c110da8d 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 @@ -1,6 +1,12 @@ 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? -} \ No newline at end of file + 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 c81ae4a9e7..d2e9895351 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 @@ -3,9 +3,15 @@ package dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts 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? -} \ No newline at end of file + get() = thumbnailMimeType +}