1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-23 00:57:13 +00:00

add Video InlineQueryResult

This commit is contained in:
InsanusMokrassar 2019-02-07 12:32:32 +08:00
parent 558800c1e4
commit 1ce4c97899
8 changed files with 137 additions and 6 deletions

View File

@ -0,0 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts
interface MimeTyped {
val mimeType: String? // TODO::replace by something like enum or interface
}

View File

@ -60,27 +60,40 @@ const val untilDateField = "until_date"
const val errorMessageField = "error_message"
const val messageTextField = "message_text"
const val photoUrlField = "photo_url"
const val photoSizeField = "photo_size"
const val photoFileIdField = "photo_file_id"
const val photoWidthField = "photo_width"
const val photoHeightField = "photo_height"
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 videoUrlField = "video_url"
const val videoFileIdField = "video_file_id"
const val videoWidthField = "video_width"
const val videoHeightField = "video_height"
const val videoDurationField = "video_duration"
const val gameShortNameField = "game_short_name"
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 inputMessageContentField = "input_message_content"
const val hideUrlField = "hide_url"
const val gameShortNameField = "game_short_name"
const val canSendMessagesField = "can_send_messages"
const val canSendMediaMessagesField = "can_send_media_messages"

View File

@ -0,0 +1,38 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
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.video.InlineQueryResultVideo
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video.InlineQueryResultVideoCached
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField
import kotlinx.serialization.Optional
import kotlinx.serialization.SerialName
data class InlineQueryResultVideoCachedImpl(
@SerialName(idField)
override val id: String,
@SerialName(videoFileIdField)
override val fileId: FileId,
@SerialName(titleField)
@Optional
override val title: String? = null,
@SerialName(descriptionField)
@Optional
override val description: 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
) : InlineQueryResultVideoCached

View File

@ -0,0 +1,49 @@
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.video.InlineQueryResultVideo
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField
import kotlinx.serialization.Optional
import kotlinx.serialization.SerialName
data class InlineQueryResultVideoImpl(
@SerialName(idField)
override val id: String,
@SerialName(videoUrlField)
override val url: String,
@SerialName(thumbUrlField)
override val thumbUrl: String,
@SerialName(mimeTypeField)
override val mimeType: String?,
@SerialName(videoWidthField)
@Optional
override val width: Int? = null,
@SerialName(videoHeightField)
@Optional
override val height: Int? = null,
@SerialName(videoDurationField)
@Optional
override val duration: Int? = null,
@SerialName(titleField)
@Optional
override val title: String? = null,
@SerialName(descriptionField)
@Optional
override val description: 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
) : InlineQueryResultVideo

View File

@ -0,0 +1,6 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.*
interface InlineQueryResultVideo : InlineQueryResultVideoCommon, UrlInlineQueryResult, ThumbedInlineQueryResult, MimeTyped, SizedInlineQueryResult, DuratedInlineResultQuery

View File

@ -0,0 +1,5 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.*
interface InlineQueryResultVideoCached : InlineQueryResultVideoCommon, WithFileIdInlineQueryResult

View File

@ -0,0 +1,15 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.results.video
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.*
interface InlineQueryResultVideoCommon : InlineQueryResult,
TitledInlineQueryResult,
DescribedInlineQueryResult,
Captioned,
WithInputMessageContentInlineQueryResult
{
override val type: String
get() = "video"
}

View File

@ -1,7 +1,7 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MimeTyped
internal const val mimeTypeField = "mime_type"
interface MimedMediaFile : TelegramMediaFile {
val mimeType: String? // TODO::replace by something like enum or interface
}
interface MimedMediaFile : TelegramMediaFile, MimeTyped