From 558800c1e477e8e2a14d4753846b2808b0468262 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 7 Feb 2019 12:15:16 +0800 Subject: [PATCH] add Mpeg4Gif InlineQueryResult --- .../TelegramBotAPI/types/Common.kt | 11 +++-- .../InlineQueryResultMpeg4GifCachedImpl.kt | 35 +++++++++++++++ .../InlineQueryResultMpeg4GifImpl.kt | 43 +++++++++++++++++++ .../mpeg4gif/InlineQueryResultMpeg4Gif.kt | 5 +++ .../InlineQueryResultMpeg4GifCached.kt | 5 +++ .../InlineQueryResultMpeg4GifCommon.kt | 13 ++++++ 6 files changed, 109 insertions(+), 3 deletions(-) create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4Gif.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCached.kt create mode 100644 src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt index 7b2733b247..a76cd5f48c 100644 --- a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/Common.kt @@ -65,14 +65,19 @@ const val photoSizeField = "photo_size" const val photoFileIdField = "photo_file_id" const val gifUrlField = "gif_url" const val gifFileIdField = "gif_file_id" +const val gifWidthField = "gif_width" +const val gifHeightField = "gif_height" +const val gifDurationField = "gif_duration" +const val mpeg4GifUrlField = "mpeg4_url" +const val mpeg4GifFileIdField = "mpeg4_file_id" +const val mpeg4GifWidthField = "mpeg4_width" +const val mpeg4GifHeightField = "mpeg4_height" +const val mpeg4GifDurationField = "mpeg4_duration" const val thumbUrlField = "thumb_url" const val thumbWidthField = "thumb_width" const val thumbHeightField = "thumb_height" const val photoWidthField = "photo_width" const val photoHeightField = "photo_height" -const val gifWidthField = "gif_width" -const val gifHeightField = "gif_height" -const val gifDurationField = "gif_duration" const val inputMessageContentField = "input_message_content" const val hideUrlField = "hide_url" const val gameShortNameField = "game_short_name" diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt new file mode 100644 index 0000000000..274e513286 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifCachedImpl.kt @@ -0,0 +1,35 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult + +import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGifCached +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4GifCached +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +data class InlineQueryResultMpeg4GifCachedImpl( + @SerialName(idField) + override val id: String, + @SerialName(mpeg4GifFileIdField) + override val fileId: FileId, + @SerialName(titleField) + @Optional + override val title: String? = null, + @SerialName(captionField) + @Optional + override val caption: String? = null, + @SerialName(parseModeField) + @Optional + override val parseMode: ParseMode? = null, + @SerialName(replyMarkupField) + @Optional + override val replyMarkup: InlineKeyboardMarkup? = null, + @SerialName(inputMessageContentField) + @Optional + override val inputMessageContent: InputMessageContent? = null +) : InlineQueryResultMpeg4GifCached diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt new file mode 100644 index 0000000000..f21d08871a --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/InlineQueryResultMpeg4GifImpl.kt @@ -0,0 +1,43 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InputMessageContent +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode +import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup +import com.github.insanusmokrassar.TelegramBotAPI.types.* +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif.InlineQueryResultMpeg4Gif +import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField +import kotlinx.serialization.Optional +import kotlinx.serialization.SerialName + +data class InlineQueryResultMpeg4GifImpl( + @SerialName(idField) + override val id: String, + @SerialName(mpeg4GifUrlField) + override val url: String, + @SerialName(thumbUrlField) + override val thumbUrl: String, + @SerialName(mpeg4GifWidthField) + @Optional + override val width: Int? = null, + @SerialName(mpeg4GifHeightField) + @Optional + override val height: Int? = null, + @SerialName(mpeg4GifDurationField) + @Optional + override val duration: Int? = null, + @SerialName(titleField) + @Optional + override val title: String? = null, + @SerialName(captionField) + @Optional + override val caption: String? = null, + @SerialName(parseModeField) + @Optional + override val parseMode: ParseMode? = null, + @SerialName(replyMarkupField) + @Optional + override val replyMarkup: InlineKeyboardMarkup? = null, + @SerialName(inputMessageContentField) + @Optional + override val inputMessageContent: InputMessageContent? = null +) : InlineQueryResultMpeg4Gif diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4Gif.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4Gif.kt new file mode 100644 index 0000000000..ffb42e5274 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4Gif.kt @@ -0,0 +1,5 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultMpeg4Gif : InlineQueryResultMpeg4GifCommon, UrlInlineQueryResult, ThumbedInlineQueryResult, SizedInlineQueryResult, DuratedInlineResultQuery \ No newline at end of file diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCached.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCached.kt new file mode 100644 index 0000000000..96023e0210 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCached.kt @@ -0,0 +1,5 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif + +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultMpeg4GifCached : InlineQueryResultMpeg4GifCommon, WithFileIdInlineQueryResult diff --git a/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt new file mode 100644 index 0000000000..0e0f86c3c7 --- /dev/null +++ b/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/InlineQueryResult/abstracts/results/mpeg4gif/InlineQueryResultMpeg4GifCommon.kt @@ -0,0 +1,13 @@ +package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.mpeg4gif + +import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned +import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.* + +interface InlineQueryResultMpeg4GifCommon : InlineQueryResult, + TitledInlineQueryResult, + Captioned, + WithInputMessageContentInlineQueryResult +{ + override val type: String + get() = "mpeg4_gif" +} \ No newline at end of file