1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 03:58:44 +00:00

extend InlineQueryResultGif fun with FileId and add ProtectContent + extend SendMessageRequest with it in advance

This commit is contained in:
InsanusMokrassar 2022-01-01 13:42:39 +06:00
parent 5c5a19c91a
commit 148791ad68
3 changed files with 39 additions and 3 deletions

View File

@ -0,0 +1,5 @@
package dev.inmo.tgbotapi.CommonAbstracts.types
interface ProtectContent {
val contentProtected: Boolean
}

View File

@ -1,6 +1,5 @@
package dev.inmo.tgbotapi.requests.send.abstracts
import dev.inmo.tgbotapi.CommonAbstracts.types.DisableNotification
import dev.inmo.tgbotapi.CommonAbstracts.types.ReplyMessageId
import dev.inmo.tgbotapi.CommonAbstracts.types.*
interface SendMessageRequest<T: Any> : SendChatMessageRequest<T>, ReplyMessageId, DisableNotification
interface SendMessageRequest<T: Any> : SendChatMessageRequest<T>, ReplyMessageId, DisableNotification, ProtectContent

View File

@ -1,5 +1,6 @@
package dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult
import dev.inmo.tgbotapi.requests.abstracts.FileId
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.InlineQueryResultGif
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.gif.inlineQueryResultGifType
@ -57,6 +58,37 @@ fun InlineQueryResultGifImpl(
inputMessageContent
)
fun InlineQueryResultGifImpl(
id: InlineQueryIdentifier,
gifFile: FileId,
thumbUrl: String,
thumbMimeType: MimeType? = null,
width: Int? = null,
height: Int? = null,
duration: Int? = null,
title: String? = null,
text: String? = null,
parseMode: ParseMode? = null,
replyMarkup: InlineKeyboardMarkup? = null,
inputMessageContent: InputMessageContent? = null
) = InlineQueryResultGifImpl(id, gifFile.fileId, thumbUrl, thumbMimeType, width, height, duration, title, text, parseMode, replyMarkup, inputMessageContent)
fun InlineQueryResultGifImpl(
id: InlineQueryIdentifier,
gifFile: FileId,
thumbUrl: String,
thumbMimeType: MimeType? = null,
width: Int? = null,
height: Int? = null,
duration: Int? = null,
title: String? = null,
entities: TextSourcesList,
replyMarkup: InlineKeyboardMarkup? = null,
inputMessageContent: InputMessageContent? = null
) = InlineQueryResultGifImpl(
id, gifFile.fileId, thumbUrl, thumbMimeType, width, height, duration, title, entities, replyMarkup, inputMessageContent
)
@Serializable
data class InlineQueryResultGifImpl internal constructor(
@SerialName(idField)