mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-09-16 13:49:26 +00:00
add support of show_caption_above_media""
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
package dev.inmo.tgbotapi.abstracts
|
||||
|
||||
interface WithCustomizableCaption : Texted {
|
||||
val showCaptionAboveMedia: Boolean
|
||||
}
|
@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.requests.edit.caption
|
||||
|
||||
import dev.inmo.tgbotapi.requests.edit.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.edit.media.MediaContentMessageResultDeserializer
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.WithCustomizableCaptionRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
@@ -22,28 +23,32 @@ fun EditChatMessageCaption(
|
||||
messageId: MessageId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = EditChatMessageCaption(
|
||||
chatId,
|
||||
messageId,
|
||||
text,
|
||||
parseMode,
|
||||
null,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
messageId = messageId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
fun EditChatMessageCaption(
|
||||
chatId: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = EditChatMessageCaption(
|
||||
chatId,
|
||||
messageId,
|
||||
entities.makeString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
messageId = messageId,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@Serializable
|
||||
@@ -58,9 +63,11 @@ data class EditChatMessageCaption internal constructor(
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(captionEntitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null
|
||||
) : EditChatMessage<MediaContent>, EditTextChatMessage, EditReplyMessage {
|
||||
) : EditChatMessage<MediaContent>, WithCustomizableCaptionRequest<ContentMessage<MediaContent>>, EditTextChatMessage, EditReplyMessage {
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
rawEntities ?.asTextSources(text)
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package dev.inmo.tgbotapi.requests.edit.text
|
||||
|
||||
import dev.inmo.tgbotapi.requests.edit.abstracts.*
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.WithCustomizableCaptionRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
@@ -16,29 +17,33 @@ fun EditInlineMessageText(
|
||||
inlineMessageId: InlineMessageId,
|
||||
text: String,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = EditInlineMessageText(
|
||||
inlineMessageId,
|
||||
text,
|
||||
parseMode,
|
||||
null,
|
||||
linkPreviewOptions,
|
||||
replyMarkup
|
||||
inlineMessageId = inlineMessageId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
fun EditInlineMessageText(
|
||||
inlineMessageId: InlineMessageId,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
replyMarkup: InlineKeyboardMarkup? = null
|
||||
) = EditInlineMessageText(
|
||||
inlineMessageId,
|
||||
entities.makeString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
linkPreviewOptions,
|
||||
replyMarkup
|
||||
inlineMessageId = inlineMessageId,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
linkPreviewOptions = linkPreviewOptions,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@Serializable
|
||||
@@ -51,11 +56,13 @@ data class EditInlineMessageText internal constructor(
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(entitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
@SerialName(linkPreviewOptionsField)
|
||||
override val linkPreviewOptions: LinkPreviewOptions? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null
|
||||
) : EditInlineMessage, EditTextChatMessage, EditReplyMessage, EditLinkPreviewOptionsContainer {
|
||||
) : EditInlineMessage, WithCustomizableCaptionRequest<Boolean>, EditTextChatMessage, EditReplyMessage, EditLinkPreviewOptionsContainer {
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
rawEntities ?.asTextSources(text)
|
||||
}
|
||||
|
@@ -1,11 +1,13 @@
|
||||
package dev.inmo.tgbotapi.requests.send
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.TextedOutput
|
||||
import dev.inmo.tgbotapi.abstracts.WithCustomizableCaption
|
||||
import dev.inmo.tgbotapi.abstracts.types.MessageAction
|
||||
import dev.inmo.tgbotapi.abstracts.types.ProtectContent
|
||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.OptionallyMessageThreadRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||
import dev.inmo.tgbotapi.requests.send.abstracts.WithCustomizableCaptionRequest
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||
import dev.inmo.tgbotapi.types.message.textsources.TextSource
|
||||
@@ -28,23 +30,25 @@ fun CopyMessage(
|
||||
messageId: MessageId,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = CopyMessage(
|
||||
toChatId,
|
||||
fromChatId,
|
||||
messageId,
|
||||
text,
|
||||
parseMode,
|
||||
null,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
toChatId = toChatId,
|
||||
fromChatId = fromChatId,
|
||||
messageId = messageId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
fun CopyMessage(
|
||||
@@ -52,23 +56,25 @@ fun CopyMessage(
|
||||
fromChatId: ChatIdentifier,
|
||||
messageId: MessageId,
|
||||
entities: List<TextSource>,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = CopyMessage(
|
||||
toChatId,
|
||||
fromChatId,
|
||||
messageId,
|
||||
entities.makeString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
toChatId = toChatId,
|
||||
fromChatId = fromChatId,
|
||||
messageId = messageId,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
fun CopyMessage(
|
||||
@@ -77,23 +83,25 @@ fun CopyMessage(
|
||||
toChatId: ChatIdentifier,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = CopyMessage(
|
||||
toChatId,
|
||||
fromChatId,
|
||||
messageId,
|
||||
text,
|
||||
parseMode,
|
||||
null,
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
toChatId = toChatId,
|
||||
fromChatId = fromChatId,
|
||||
messageId = messageId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
fun CopyMessage(
|
||||
@@ -101,23 +109,25 @@ fun CopyMessage(
|
||||
messageId: MessageId,
|
||||
toChatId: ChatIdentifier,
|
||||
entities: List<TextSource>,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
threadId: MessageThreadId? = toChatId.threadId,
|
||||
disableNotification: Boolean = false,
|
||||
protectContent: Boolean = false,
|
||||
replyParameters: ReplyParameters? = null,
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
) = CopyMessage(
|
||||
toChatId,
|
||||
fromChatId,
|
||||
messageId,
|
||||
entities.makeString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
threadId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
toChatId = toChatId,
|
||||
fromChatId = fromChatId,
|
||||
messageId = messageId,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
threadId = threadId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
@Serializable
|
||||
@@ -134,6 +144,8 @@ data class CopyMessage internal constructor(
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(captionEntitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
@SerialName(messageThreadIdField)
|
||||
override val threadId: MessageThreadId? = toChatId.threadId,
|
||||
@SerialName(disableNotificationField)
|
||||
@@ -146,6 +158,7 @@ data class CopyMessage internal constructor(
|
||||
override val replyMarkup: KeyboardMarkup? = null
|
||||
): SimpleRequest<MessageId>,
|
||||
ReplyingMarkupSendMessageRequest<MessageId>,
|
||||
WithCustomizableCaptionRequest<MessageId>,
|
||||
MessageAction,
|
||||
TextedOutput,
|
||||
ProtectContent,
|
||||
|
@@ -0,0 +1,6 @@
|
||||
package dev.inmo.tgbotapi.requests.send.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.WithCustomizableCaption
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
|
||||
interface WithCustomizableCaptionRequest<T : Any> : Request<T>, WithCustomizableCaption
|
@@ -27,6 +27,7 @@ fun SendAnimation(
|
||||
thumbnail: InputFile? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
@@ -42,22 +43,23 @@ fun SendAnimation(
|
||||
val thumbAsFile = thumbnail as? MultipartFile
|
||||
|
||||
val data = SendAnimationData(
|
||||
chatId,
|
||||
animation,
|
||||
thumbnail ?.fileId,
|
||||
text,
|
||||
parseMode,
|
||||
null,
|
||||
spoilered,
|
||||
duration,
|
||||
width,
|
||||
height,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
animation = animation,
|
||||
thumbnail = thumbnail ?.fileId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
return if (animationAsFile == null && thumbAsFile == null) {
|
||||
@@ -75,6 +77,7 @@ fun SendAnimation(
|
||||
animation: InputFile,
|
||||
thumbnail: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
@@ -90,22 +93,23 @@ fun SendAnimation(
|
||||
val thumbAsFile = thumbnail as? MultipartFile
|
||||
|
||||
val data = SendAnimationData(
|
||||
chatId,
|
||||
animation,
|
||||
thumbnail ?.fileId,
|
||||
entities.makeString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
spoilered,
|
||||
duration,
|
||||
width,
|
||||
height,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
animation = animation,
|
||||
thumbnail = thumbnail ?.fileId,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
return if (animationAsFile == null && thumbAsFile == null) {
|
||||
@@ -135,6 +139,8 @@ data class SendAnimationData internal constructor(
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(captionEntitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
@SerialName(hasSpoilerField)
|
||||
override val spoilered: Boolean = false,
|
||||
@SerialName(durationField)
|
||||
@@ -162,6 +168,7 @@ data class SendAnimationData internal constructor(
|
||||
ThumbedSendMessageRequest<ContentMessage<AnimationContent>>,
|
||||
DuratedSendMessageRequest<ContentMessage<AnimationContent>>,
|
||||
SizedSendMessageRequest<ContentMessage<AnimationContent>>,
|
||||
WithCustomizableCaptionRequest<ContentMessage<AnimationContent>>,
|
||||
OptionallyWithSpoilerRequest
|
||||
{
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
|
@@ -25,6 +25,7 @@ fun SendPhoto(
|
||||
photo: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@@ -34,18 +35,19 @@ fun SendPhoto(
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): Request<ContentMessage<PhotoContent>> {
|
||||
val data = SendPhotoData(
|
||||
chatId,
|
||||
photo,
|
||||
text,
|
||||
parseMode,
|
||||
null,
|
||||
spoilered,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
photo = photo,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
return if (photo is MultipartFile) {
|
||||
CommonMultipartFileRequest(
|
||||
@@ -61,6 +63,7 @@ fun SendPhoto(
|
||||
chatId: ChatIdentifier,
|
||||
photo: InputFile,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@@ -70,18 +73,19 @@ fun SendPhoto(
|
||||
replyMarkup: KeyboardMarkup? = null
|
||||
): Request<ContentMessage<PhotoContent>> {
|
||||
val data = SendPhotoData(
|
||||
chatId,
|
||||
photo,
|
||||
entities.makeString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
spoilered,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
photo = photo,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
return if (photo is MultipartFile) {
|
||||
@@ -109,6 +113,8 @@ data class SendPhotoData internal constructor(
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(captionEntitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
@SerialName(hasSpoilerField)
|
||||
override val spoilered: Boolean = false,
|
||||
@SerialName(messageThreadIdField)
|
||||
@@ -127,6 +133,7 @@ data class SendPhotoData internal constructor(
|
||||
SendContentMessageRequest<ContentMessage<PhotoContent>>,
|
||||
ReplyingMarkupSendMessageRequest<ContentMessage<PhotoContent>>,
|
||||
TextableSendMessageRequest<ContentMessage<PhotoContent>>,
|
||||
WithCustomizableCaptionRequest<ContentMessage<PhotoContent>>,
|
||||
OptionallyWithSpoilerRequest
|
||||
{
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
|
@@ -27,6 +27,7 @@ fun SendVideo(
|
||||
thumbnail: InputFile? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
@@ -43,23 +44,24 @@ fun SendVideo(
|
||||
val thumbAsFile = thumbnail as? MultipartFile
|
||||
|
||||
val data = SendVideoData(
|
||||
chatId,
|
||||
video,
|
||||
thumbnail ?.fileId,
|
||||
text,
|
||||
parseMode,
|
||||
null,
|
||||
spoilered,
|
||||
duration,
|
||||
width,
|
||||
height,
|
||||
supportStreaming,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
video = video,
|
||||
thumbnail = thumbnail ?.fileId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
supportStreaming = supportStreaming,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
return if (videoAsFile == null && thumbAsFile == null) {
|
||||
@@ -77,6 +79,7 @@ fun SendVideo(
|
||||
video: InputFile,
|
||||
thumbnail: InputFile? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
spoilered: Boolean = false,
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
@@ -93,23 +96,24 @@ fun SendVideo(
|
||||
val thumbAsFile = thumbnail as? MultipartFile
|
||||
|
||||
val data = SendVideoData(
|
||||
chatId,
|
||||
video,
|
||||
thumbnail ?.fileId,
|
||||
entities.makeString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
spoilered,
|
||||
duration,
|
||||
width,
|
||||
height,
|
||||
supportStreaming,
|
||||
threadId,
|
||||
businessConnectionId,
|
||||
disableNotification,
|
||||
protectContent,
|
||||
replyParameters,
|
||||
replyMarkup
|
||||
chatId = chatId,
|
||||
video = video,
|
||||
thumbnail = thumbnail ?.fileId,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
spoilered = spoilered,
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
supportStreaming = supportStreaming,
|
||||
threadId = threadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
disableNotification = disableNotification,
|
||||
protectContent = protectContent,
|
||||
replyParameters = replyParameters,
|
||||
replyMarkup = replyMarkup
|
||||
)
|
||||
|
||||
return if (videoAsFile == null && thumbAsFile == null) {
|
||||
@@ -139,6 +143,8 @@ data class SendVideoData internal constructor(
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(captionEntitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
@SerialName(hasSpoilerField)
|
||||
override val spoilered: Boolean = false,
|
||||
@SerialName(durationField)
|
||||
@@ -168,6 +174,7 @@ data class SendVideoData internal constructor(
|
||||
ThumbedSendMessageRequest<ContentMessage<VideoContent>>,
|
||||
DuratedSendMessageRequest<ContentMessage<VideoContent>>,
|
||||
SizedSendMessageRequest<ContentMessage<VideoContent>>,
|
||||
WithCustomizableCaptionRequest<ContentMessage<VideoContent>>,
|
||||
OptionallyWithSpoilerRequest
|
||||
{
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
|
@@ -227,6 +227,7 @@ const val canEditStoriesField = "can_edit_stories"
|
||||
const val canDeleteStoriesField = "can_delete_stories"
|
||||
const val captionEntitiesField = "caption_entities"
|
||||
const val hasSpoilerField = "has_spoiler"
|
||||
const val showCaptionAboveMediaField = "show_caption_above_media"
|
||||
const val loginUrlField = "login_url"
|
||||
const val forwardTextField = "forward_text"
|
||||
const val botUsernameField = "bot_username"
|
||||
|
@@ -22,26 +22,39 @@ fun InlineQueryResultGifCachedImpl(
|
||||
title: String? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultGifCachedImpl(id, fileId, title, text, parseMode, null, replyMarkup, inputMessageContent)
|
||||
) = InlineQueryResultGifCachedImpl(
|
||||
id = id,
|
||||
fileId = fileId,
|
||||
title = title,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
fun InlineQueryResultGifCachedImpl(
|
||||
id: InlineQueryId,
|
||||
fileId: FileId,
|
||||
title: String? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultGifCachedImpl(
|
||||
id,
|
||||
fileId,
|
||||
title,
|
||||
entities.makeString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
replyMarkup,
|
||||
inputMessageContent
|
||||
id = id,
|
||||
fileId = fileId,
|
||||
title = title,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
@Serializable
|
||||
@@ -58,6 +71,8 @@ data class InlineQueryResultGifCachedImpl internal constructor(
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(captionEntitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||
@SerialName(inputMessageContentField)
|
||||
|
@@ -28,9 +28,25 @@ fun InlineQueryResultGifImpl(
|
||||
title: String? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultGifImpl(id, url, thumbnailUrl, thumbnailMimeType, width, height, duration, title, text, parseMode, null, replyMarkup, inputMessageContent)
|
||||
) = InlineQueryResultGifImpl(
|
||||
id = id,
|
||||
url = url,
|
||||
thumbnailUrl = thumbnailUrl,
|
||||
thumbnailMimeType = thumbnailMimeType,
|
||||
width = width,
|
||||
height = height,
|
||||
duration = duration,
|
||||
title = title,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
fun InlineQueryResultGifImpl(
|
||||
id: InlineQueryId,
|
||||
@@ -42,22 +58,24 @@ fun InlineQueryResultGifImpl(
|
||||
duration: Int? = null,
|
||||
title: String? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultGifImpl(
|
||||
id,
|
||||
url,
|
||||
thumbnailUrl,
|
||||
thumbnailMimeType,
|
||||
width,
|
||||
height,
|
||||
duration,
|
||||
title,
|
||||
entities.makeString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
replyMarkup,
|
||||
inputMessageContent
|
||||
id = id,
|
||||
url = url,
|
||||
thumbnailUrl = thumbnailUrl,
|
||||
thumbnailMimeType = thumbnailMimeType,
|
||||
width = width,
|
||||
height = height,
|
||||
duration = duration,
|
||||
title = title,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
fun InlineQueryResultGifImpl(
|
||||
@@ -71,9 +89,24 @@ fun InlineQueryResultGifImpl(
|
||||
title: String? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultGifImpl(id, gifFile.fileId, thumbnailUrl, thumbnailMimeType, width, height, duration, title, text, parseMode, replyMarkup, inputMessageContent)
|
||||
) = InlineQueryResultGifImpl(
|
||||
id = id,
|
||||
url = gifFile.fileId,
|
||||
thumbnailUrl = thumbnailUrl,
|
||||
thumbnailMimeType = thumbnailMimeType,
|
||||
width = width,
|
||||
height = height,
|
||||
duration = duration,
|
||||
title = title,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
fun InlineQueryResultGifImpl(
|
||||
id: InlineQueryId,
|
||||
@@ -85,10 +118,22 @@ fun InlineQueryResultGifImpl(
|
||||
duration: Int? = null,
|
||||
title: String? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultGifImpl(
|
||||
id, gifFile.fileId, thumbnailUrl, thumbnailMimeType, width, height, duration, title, entities, replyMarkup, inputMessageContent
|
||||
id = id,
|
||||
url = gifFile.fileId,
|
||||
thumbnailUrl = thumbnailUrl,
|
||||
thumbnailMimeType = thumbnailMimeType,
|
||||
width = width,
|
||||
height = height,
|
||||
duration = duration,
|
||||
title = title,
|
||||
entities = entities,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
@Serializable
|
||||
@@ -115,6 +160,8 @@ data class InlineQueryResultGifImpl internal constructor(
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(captionEntitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||
@SerialName(inputMessageContentField)
|
||||
|
@@ -22,26 +22,39 @@ fun InlineQueryResultMpeg4GifCachedImpl(
|
||||
title: String? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultMpeg4GifCachedImpl(id, fileId, title, text, parseMode, null, replyMarkup, inputMessageContent)
|
||||
) = InlineQueryResultMpeg4GifCachedImpl(
|
||||
id = id,
|
||||
fileId = fileId,
|
||||
title = title,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
fun InlineQueryResultMpeg4GifCachedImpl(
|
||||
id: InlineQueryId,
|
||||
fileId: FileId,
|
||||
title: String? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultMpeg4GifCachedImpl(
|
||||
id,
|
||||
fileId,
|
||||
title,
|
||||
entities.makeString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
replyMarkup,
|
||||
inputMessageContent
|
||||
id = id,
|
||||
fileId = fileId,
|
||||
title = title,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
@Serializable
|
||||
@@ -58,6 +71,8 @@ data class InlineQueryResultMpeg4GifCachedImpl internal constructor(
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(captionEntitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||
@SerialName(inputMessageContentField)
|
||||
|
@@ -27,9 +27,25 @@ fun InlineQueryResultMpeg4GifImpl(
|
||||
title: String? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultMpeg4GifImpl(id, url, thumbnailUrl, thumbnailMimeType, width, height, duration, title, text, parseMode, null, replyMarkup, inputMessageContent)
|
||||
) = InlineQueryResultMpeg4GifImpl(
|
||||
id = id,
|
||||
url = url,
|
||||
thumbnailUrl = thumbnailUrl,
|
||||
thumbnailMimeType = thumbnailMimeType,
|
||||
width = width,
|
||||
height = height,
|
||||
duration = duration,
|
||||
title = title,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
fun InlineQueryResultMpeg4GifImpl(
|
||||
id: InlineQueryId,
|
||||
@@ -41,22 +57,24 @@ fun InlineQueryResultMpeg4GifImpl(
|
||||
duration: Int? = null,
|
||||
title: String? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultMpeg4GifImpl(
|
||||
id,
|
||||
url,
|
||||
thumbnailUrl,
|
||||
thumbnailMimeType,
|
||||
width,
|
||||
height,
|
||||
duration,
|
||||
title,
|
||||
entities.makeString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
replyMarkup,
|
||||
inputMessageContent
|
||||
id = id,
|
||||
url = url,
|
||||
thumbnailUrl = thumbnailUrl,
|
||||
thumbnailMimeType = thumbnailMimeType,
|
||||
width = width,
|
||||
height = height,
|
||||
duration = duration,
|
||||
title = title,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
@Serializable
|
||||
@@ -83,6 +101,8 @@ data class InlineQueryResultMpeg4GifImpl internal constructor(
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(captionEntitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||
@SerialName(inputMessageContentField)
|
||||
|
@@ -23,9 +23,21 @@ fun InlineQueryResultPhotoCachedImpl(
|
||||
description: String? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultPhotoCachedImpl(id, fileId, title, description, text, parseMode, null, replyMarkup, inputMessageContent)
|
||||
) = InlineQueryResultPhotoCachedImpl(
|
||||
id = id,
|
||||
fileId = fileId,
|
||||
title = title,
|
||||
description = description,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
fun InlineQueryResultPhotoCachedImpl(
|
||||
id: InlineQueryId,
|
||||
@@ -33,18 +45,20 @@ fun InlineQueryResultPhotoCachedImpl(
|
||||
title: String? = null,
|
||||
description: String? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultPhotoCachedImpl(
|
||||
id,
|
||||
fileId,
|
||||
title,
|
||||
description,
|
||||
entities.makeString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
replyMarkup,
|
||||
inputMessageContent
|
||||
id = id,
|
||||
fileId = fileId,
|
||||
title = title,
|
||||
description = description,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
@Serializable
|
||||
@@ -63,6 +77,8 @@ data class InlineQueryResultPhotoCachedImpl internal constructor(
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(captionEntitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||
@SerialName(inputMessageContentField)
|
||||
|
@@ -25,9 +25,24 @@ fun InlineQueryResultPhotoImpl(
|
||||
description: String? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultPhotoImpl(id, url, thumbnailUrl, width, height, title, description, text, parseMode, null, replyMarkup, inputMessageContent)
|
||||
) = InlineQueryResultPhotoImpl(
|
||||
id = id,
|
||||
url = url,
|
||||
thumbnailUrl = thumbnailUrl,
|
||||
width = width,
|
||||
height = height,
|
||||
title = title,
|
||||
description = description,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
fun InlineQueryResultPhotoImpl(
|
||||
id: InlineQueryId,
|
||||
@@ -38,21 +53,23 @@ fun InlineQueryResultPhotoImpl(
|
||||
title: String? = null,
|
||||
description: String? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultPhotoImpl(
|
||||
id,
|
||||
url,
|
||||
thumbnailUrl,
|
||||
width,
|
||||
height,
|
||||
title,
|
||||
description,
|
||||
entities.makeString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
replyMarkup,
|
||||
inputMessageContent
|
||||
id = id,
|
||||
url = url,
|
||||
thumbnailUrl = thumbnailUrl,
|
||||
width = width,
|
||||
height = height,
|
||||
title = title,
|
||||
description = description,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
@Serializable
|
||||
@@ -77,6 +94,8 @@ data class InlineQueryResultPhotoImpl internal constructor(
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(captionEntitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||
@SerialName(inputMessageContentField)
|
||||
|
@@ -23,9 +23,21 @@ fun InlineQueryResultVideoCachedImpl(
|
||||
description: String? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultVideoCachedImpl(id, fileId, title, description, text, parseMode, null, replyMarkup, inputMessageContent)
|
||||
) = InlineQueryResultVideoCachedImpl(
|
||||
id = id,
|
||||
fileId = fileId,
|
||||
title = title,
|
||||
description = description,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
fun InlineQueryResultVideoCachedImpl(
|
||||
id: InlineQueryId,
|
||||
@@ -33,18 +45,20 @@ fun InlineQueryResultVideoCachedImpl(
|
||||
title: String,
|
||||
description: String? = null,
|
||||
entities: TextSourcesList,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultVideoCachedImpl(
|
||||
id,
|
||||
fileId,
|
||||
title,
|
||||
description,
|
||||
entities.makeString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
replyMarkup,
|
||||
inputMessageContent
|
||||
id = id,
|
||||
fileId = fileId,
|
||||
title = title,
|
||||
description = description,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
@Serializable
|
||||
@@ -63,6 +77,8 @@ data class InlineQueryResultVideoCachedImpl internal constructor(
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(captionEntitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||
@SerialName(inputMessageContentField)
|
||||
|
@@ -28,9 +28,26 @@ fun InlineQueryResultVideoImpl(
|
||||
description: String? = null,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultVideoImpl(id, url, thumbnailUrl, mimeType, title, width, height, duration, description, text, parseMode, null, replyMarkup, inputMessageContent)
|
||||
) = InlineQueryResultVideoImpl(
|
||||
id = id,
|
||||
url = url,
|
||||
thumbnailUrl = thumbnailUrl,
|
||||
mimeType = mimeType,
|
||||
title = title,
|
||||
width = width,
|
||||
height = height,
|
||||
duration = duration,
|
||||
description = description,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
fun InlineQueryResultVideoImpl(
|
||||
id: InlineQueryId,
|
||||
@@ -43,23 +60,25 @@ fun InlineQueryResultVideoImpl(
|
||||
duration: Int? = null,
|
||||
description: String? = null,
|
||||
entities: List<TextSource>,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
replyMarkup: InlineKeyboardMarkup? = null,
|
||||
inputMessageContent: InputMessageContent? = null
|
||||
) = InlineQueryResultVideoImpl(
|
||||
id,
|
||||
url,
|
||||
thumbnailUrl,
|
||||
mimeType,
|
||||
title,
|
||||
width,
|
||||
height,
|
||||
duration,
|
||||
description,
|
||||
entities.makeString(),
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
replyMarkup,
|
||||
inputMessageContent
|
||||
id = id,
|
||||
url = url,
|
||||
thumbnailUrl = thumbnailUrl,
|
||||
mimeType = mimeType,
|
||||
title = title,
|
||||
width = width,
|
||||
height = height,
|
||||
duration = duration,
|
||||
description = description,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
replyMarkup = replyMarkup,
|
||||
inputMessageContent = inputMessageContent
|
||||
)
|
||||
|
||||
@Serializable
|
||||
@@ -88,6 +107,8 @@ data class InlineQueryResultVideoImpl internal constructor(
|
||||
override val parseMode: ParseMode? = null,
|
||||
@SerialName(captionEntitiesField)
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: InlineKeyboardMarkup? = null,
|
||||
@SerialName(inputMessageContentField)
|
||||
|
@@ -0,0 +1,5 @@
|
||||
package dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.WithCustomizableCaption
|
||||
|
||||
interface WithCustomizableCaptionInlineQueryResult : InlineQueryResult, WithCustomizableCaption
|
@@ -8,4 +8,5 @@ const val inlineQueryResultGifType = "gif"
|
||||
interface InlineQueryResultGifCommon : InlineQueryResult,
|
||||
OptionallyTitledInlineQueryResult,
|
||||
TextedOutput,
|
||||
WithInputMessageContentInlineQueryResult
|
||||
WithInputMessageContentInlineQueryResult,
|
||||
WithCustomizableCaptionInlineQueryResult
|
||||
|
@@ -8,4 +8,5 @@ const val inlineQueryResultMpeg4GifType = "mpeg4_gif"
|
||||
interface InlineQueryResultMpeg4GifCommon : InlineQueryResult,
|
||||
OptionallyTitledInlineQueryResult,
|
||||
TextedOutput,
|
||||
WithInputMessageContentInlineQueryResult
|
||||
WithInputMessageContentInlineQueryResult,
|
||||
WithCustomizableCaptionInlineQueryResult
|
||||
|
@@ -9,4 +9,5 @@ interface InlineQueryResultPhotoCommon : InlineQueryResult,
|
||||
OptionallyTitledInlineQueryResult,
|
||||
DescribedInlineQueryResult,
|
||||
TextedOutput,
|
||||
WithInputMessageContentInlineQueryResult
|
||||
WithInputMessageContentInlineQueryResult,
|
||||
WithCustomizableCaptionInlineQueryResult
|
||||
|
@@ -9,4 +9,5 @@ interface InlineQueryResultVideoCommon : InlineQueryResult,
|
||||
TitledInlineQueryResult,
|
||||
DescribedInlineQueryResult,
|
||||
TextedOutput,
|
||||
WithInputMessageContentInlineQueryResult
|
||||
WithInputMessageContentInlineQueryResult,
|
||||
WithCustomizableCaptionInlineQueryResult
|
||||
|
@@ -36,28 +36,32 @@ data class VideoFile(
|
||||
inline fun VideoFile.toTelegramMediaVideo(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
spoilered: Boolean = false
|
||||
spoilered: Boolean = false,
|
||||
showCaptionAboveMedia: Boolean = false
|
||||
) = TelegramMediaVideo(
|
||||
fileId,
|
||||
text,
|
||||
parseMode,
|
||||
spoilered,
|
||||
width,
|
||||
height,
|
||||
duration,
|
||||
thumbnail ?.fileId
|
||||
file = fileId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
spoilered = spoilered,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
width = width,
|
||||
height = height,
|
||||
duration = duration,
|
||||
thumb = thumbnail ?.fileId
|
||||
)
|
||||
|
||||
@Suppress("NOTHING_TO_INLINE")
|
||||
inline fun VideoFile.toTelegramMediaVideo(
|
||||
textSources: TextSourcesList,
|
||||
spoilered: Boolean = false
|
||||
spoilered: Boolean = false,
|
||||
showCaptionAboveMedia: Boolean = false
|
||||
) = TelegramMediaVideo(
|
||||
fileId,
|
||||
textSources,
|
||||
spoilered,
|
||||
width,
|
||||
height,
|
||||
duration,
|
||||
thumbnail ?.fileId
|
||||
file = fileId,
|
||||
entities = textSources,
|
||||
spoilered = spoilered,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
width = width,
|
||||
height = height,
|
||||
duration = duration,
|
||||
thumb = thumbnail ?.fileId
|
||||
)
|
||||
|
@@ -20,4 +20,4 @@ sealed interface AudioMediaGroupMemberTelegramMedia: MediaGroupMemberTelegramMed
|
||||
sealed interface DocumentMediaGroupMemberTelegramMedia: MediaGroupMemberTelegramMedia
|
||||
|
||||
@Serializable(MediaGroupMemberTelegramMediaSerializer::class)
|
||||
sealed interface VisualMediaGroupMemberTelegramMedia : MediaGroupMemberTelegramMedia, SpoilerableTelegramMedia
|
||||
sealed interface VisualMediaGroupMemberTelegramMedia : MediaGroupMemberTelegramMedia, SpoilerableTelegramMedia, WithCustomizableCaptionTelegramMedia
|
||||
|
@@ -19,16 +19,18 @@ fun TelegramMediaAnimation(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
spoilered: Boolean = false,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
duration: Long? = null,
|
||||
thumb: InputFile? = null
|
||||
) = TelegramMediaAnimation(file, text, parseMode, null, spoilered, width, height, duration, thumb)
|
||||
) = TelegramMediaAnimation(file, text, parseMode, null, spoilered, showCaptionAboveMedia, width, height, duration, thumb)
|
||||
|
||||
fun TelegramMediaAnimation(
|
||||
file: InputFile,
|
||||
entities: TextSourcesList,
|
||||
spoilered: Boolean = false,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
duration: Long? = null,
|
||||
@@ -39,6 +41,7 @@ fun TelegramMediaAnimation(
|
||||
null,
|
||||
entities.toRawMessageEntities(),
|
||||
spoilered,
|
||||
showCaptionAboveMedia,
|
||||
width,
|
||||
height,
|
||||
duration,
|
||||
@@ -56,11 +59,13 @@ data class TelegramMediaAnimation internal constructor(
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(hasSpoilerField)
|
||||
override val spoilered: Boolean = false,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
override val width: Int? = null,
|
||||
override val height: Int? = null,
|
||||
override val duration: Long? = null,
|
||||
override val thumb: InputFile? = null
|
||||
) : TelegramMedia, SizedTelegramMedia, DuratedTelegramMedia, ThumbedTelegramMedia, TextedOutput, SpoilerableTelegramMedia {
|
||||
) : TelegramMedia, SizedTelegramMedia, DuratedTelegramMedia, ThumbedTelegramMedia, TextedOutput, SpoilerableTelegramMedia, WithCustomizableCaptionTelegramMedia {
|
||||
override val type: String = "animation"
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
rawEntities ?.asTextSources(text ?: return@lazy null)
|
||||
|
@@ -19,14 +19,16 @@ fun TelegramMediaPhoto(
|
||||
file: InputFile,
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
spoilered: Boolean = false
|
||||
) = TelegramMediaPhoto(file, text, parseMode, null, spoilered)
|
||||
spoilered: Boolean = false,
|
||||
showCaptionAboveMedia: Boolean = false
|
||||
) = TelegramMediaPhoto(file, text, parseMode, null, spoilered, showCaptionAboveMedia)
|
||||
|
||||
fun TelegramMediaPhoto(
|
||||
file: InputFile,
|
||||
entities: TextSourcesList,
|
||||
spoilered: Boolean = false
|
||||
) = TelegramMediaPhoto(file, entities.makeString(), null, entities.toRawMessageEntities(), spoilered)
|
||||
spoilered: Boolean = false,
|
||||
showCaptionAboveMedia: Boolean = false
|
||||
) = TelegramMediaPhoto(file, entities.makeString(), null, entities.toRawMessageEntities(), spoilered, showCaptionAboveMedia)
|
||||
|
||||
@Serializable
|
||||
data class TelegramMediaPhoto internal constructor(
|
||||
@@ -39,6 +41,8 @@ data class TelegramMediaPhoto internal constructor(
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(hasSpoilerField)
|
||||
override val spoilered: Boolean = false,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
) : TelegramMedia, VisualMediaGroupMemberTelegramMedia {
|
||||
override val type: String = photoTelegramMediaType
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
@@ -55,19 +59,23 @@ data class TelegramMediaPhoto internal constructor(
|
||||
fun PhotoSize.toTelegramMediaPhoto(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
spoilered: Boolean = false
|
||||
spoilered: Boolean = false,
|
||||
showCaptionAboveMedia: Boolean = false
|
||||
): TelegramMediaPhoto = TelegramMediaPhoto(
|
||||
fileId,
|
||||
text,
|
||||
parseMode,
|
||||
spoilered
|
||||
file = fileId,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
spoilered = spoilered,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia
|
||||
)
|
||||
|
||||
fun PhotoSize.toTelegramMediaPhoto(
|
||||
textSources: TextSourcesList = emptyList(),
|
||||
spoilered: Boolean = false
|
||||
spoilered: Boolean = false,
|
||||
showCaptionAboveMedia: Boolean = false
|
||||
): TelegramMediaPhoto = TelegramMediaPhoto(
|
||||
fileId,
|
||||
textSources,
|
||||
spoilered
|
||||
file = fileId,
|
||||
entities = textSources,
|
||||
spoilered = spoilered,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia
|
||||
)
|
||||
|
@@ -19,21 +19,45 @@ fun TelegramMediaVideo(
|
||||
text: String? = null,
|
||||
parseMode: ParseMode? = null,
|
||||
spoilered: Boolean = false,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
duration: Long? = null,
|
||||
thumb: InputFile? = null
|
||||
) = TelegramMediaVideo(file, text, parseMode, null, spoilered, width, height, duration, thumb)
|
||||
) = TelegramMediaVideo(
|
||||
file = file,
|
||||
text = text,
|
||||
parseMode = parseMode,
|
||||
rawEntities = null,
|
||||
spoilered = spoilered,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
width = width,
|
||||
height = height,
|
||||
duration = duration,
|
||||
thumb = thumb
|
||||
)
|
||||
|
||||
fun TelegramMediaVideo(
|
||||
file: InputFile,
|
||||
entities: TextSourcesList,
|
||||
spoilered: Boolean = false,
|
||||
showCaptionAboveMedia: Boolean = false,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
duration: Long? = null,
|
||||
thumb: InputFile? = null
|
||||
) = TelegramMediaVideo(file, entities.makeString(), null, entities.toRawMessageEntities(), spoilered, width, height, duration, thumb)
|
||||
) = TelegramMediaVideo(
|
||||
file = file,
|
||||
text = entities.makeString(),
|
||||
parseMode = null,
|
||||
rawEntities = entities.toRawMessageEntities(),
|
||||
spoilered = spoilered,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
width = width,
|
||||
height = height,
|
||||
duration = duration,
|
||||
thumb = thumb
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class TelegramMediaVideo internal constructor (
|
||||
@@ -46,6 +70,8 @@ data class TelegramMediaVideo internal constructor (
|
||||
private val rawEntities: List<RawMessageEntity>? = null,
|
||||
@SerialName(hasSpoilerField)
|
||||
override val spoilered: Boolean = false,
|
||||
@SerialName(showCaptionAboveMediaField)
|
||||
override val showCaptionAboveMedia: Boolean = false,
|
||||
override val width: Int? = null,
|
||||
override val height: Int? = null,
|
||||
override val duration: Long? = null,
|
||||
|
@@ -0,0 +1,5 @@
|
||||
package dev.inmo.tgbotapi.types.media
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.WithCustomizableCaption
|
||||
|
||||
sealed interface WithCustomizableCaptionTelegramMedia : TelegramMedia, WithCustomizableCaption
|
@@ -145,6 +145,8 @@ internal data class RawMessage(
|
||||
|
||||
private val effect_id: EffectId? = null,
|
||||
|
||||
private val show_caption_above_media: Boolean = false,
|
||||
|
||||
private val reply_markup: InlineKeyboardMarkup? = null,
|
||||
|
||||
// Business
|
||||
@@ -178,7 +180,8 @@ internal data class RawMessage(
|
||||
caption,
|
||||
adaptedCaptionEntities,
|
||||
has_media_spoiler ?: false,
|
||||
quote
|
||||
quote,
|
||||
show_caption_above_media
|
||||
)
|
||||
animation != null -> AnimationContent(
|
||||
animation,
|
||||
@@ -186,7 +189,8 @@ internal data class RawMessage(
|
||||
caption,
|
||||
adaptedCaptionEntities,
|
||||
has_media_spoiler ?: false,
|
||||
quote
|
||||
quote,
|
||||
show_caption_above_media
|
||||
)
|
||||
document != null -> DocumentContent(
|
||||
document,
|
||||
@@ -205,7 +209,8 @@ internal data class RawMessage(
|
||||
caption,
|
||||
adaptedCaptionEntities,
|
||||
has_media_spoiler ?: false,
|
||||
quote
|
||||
quote,
|
||||
show_caption_above_media
|
||||
)
|
||||
sticker != null -> StickerContent(sticker)
|
||||
dice != null -> DiceContent(dice)
|
||||
|
@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.types.message.content
|
||||
|
||||
import dev.inmo.tgbotapi.abstracts.SpoilerableData
|
||||
import dev.inmo.tgbotapi.abstracts.TextedInput
|
||||
import dev.inmo.tgbotapi.abstracts.WithCustomizableCaption
|
||||
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
@@ -142,6 +143,7 @@ sealed interface MediaContent: MessageContent {
|
||||
}
|
||||
|
||||
sealed interface SpoilerableMediaContent : MediaContent, SpoilerableData
|
||||
sealed interface WithCustomizedCaptionMediaContent : MediaContent, TextedContent, WithCustomizableCaption
|
||||
|
||||
@ClassCastsIncluded
|
||||
sealed interface ResendableContent {
|
||||
|
@@ -38,6 +38,6 @@ sealed interface MediaGroupPartContent : TextedMediaContent {
|
||||
fun toMediaGroupMemberTelegramMedia(): MediaGroupMemberTelegramMedia
|
||||
}
|
||||
|
||||
sealed interface VisualMediaGroupPartContent : MediaGroupPartContent, SpoilerableMediaContent {
|
||||
sealed interface VisualMediaGroupPartContent : MediaGroupPartContent, SpoilerableMediaContent, WithCustomizedCaptionMediaContent {
|
||||
override fun toMediaGroupMemberTelegramMedia(): VisualMediaGroupMemberTelegramMedia
|
||||
}
|
||||
|
@@ -19,8 +19,9 @@ data class AnimationContent(
|
||||
override val text: String?,
|
||||
override val textSources: TextSourcesList = emptyList(),
|
||||
override val spoilered: Boolean = false,
|
||||
override val quote: TextQuote? = null
|
||||
) : TextedMediaContent, SpoilerableMediaContent {
|
||||
override val quote: TextQuote? = null,
|
||||
override val showCaptionAboveMedia: Boolean = false
|
||||
) : TextedMediaContent, SpoilerableMediaContent, WithCustomizedCaptionMediaContent {
|
||||
override fun createResend(
|
||||
chatId: ChatIdentifier,
|
||||
messageThreadId: MessageThreadId?,
|
||||
@@ -47,12 +48,13 @@ data class AnimationContent(
|
||||
)
|
||||
|
||||
override fun asTelegramMedia(): TelegramMediaAnimation = TelegramMediaAnimation(
|
||||
media.fileId,
|
||||
textSources,
|
||||
spoilered,
|
||||
media.width,
|
||||
media.height,
|
||||
media.duration,
|
||||
media.thumbnail ?.fileId
|
||||
file = media.fileId,
|
||||
entities = textSources,
|
||||
spoilered = spoilered,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia,
|
||||
width = media.width,
|
||||
height = media.height,
|
||||
duration = media.duration,
|
||||
thumb = media.thumbnail ?.fileId
|
||||
)
|
||||
}
|
||||
|
@@ -19,7 +19,8 @@ data class PhotoContent(
|
||||
override val text: String? = null,
|
||||
override val textSources: TextSourcesList = emptyList(),
|
||||
override val spoilered: Boolean = false,
|
||||
override val quote: TextQuote? = null
|
||||
override val quote: TextQuote? = null,
|
||||
override val showCaptionAboveMedia: Boolean = false
|
||||
) : MediaCollectionContent<PhotoSize>, VisualMediaGroupPartContent, WithOptionalQuoteInfo {
|
||||
override val media: PhotoSize = mediaCollection.biggest() ?: throw IllegalStateException("Can't locate any photo size for this content")
|
||||
|
||||
@@ -46,5 +47,5 @@ data class PhotoContent(
|
||||
|
||||
override fun toMediaGroupMemberTelegramMedia(): TelegramMediaPhoto = asTelegramMedia()
|
||||
|
||||
override fun asTelegramMedia(): TelegramMediaPhoto = media.toTelegramMediaPhoto(textSources, spoilered)
|
||||
override fun asTelegramMedia(): TelegramMediaPhoto = media.toTelegramMediaPhoto(textSources, spoilered, showCaptionAboveMedia)
|
||||
}
|
||||
|
@@ -18,7 +18,8 @@ data class VideoContent(
|
||||
override val text: String? = null,
|
||||
override val textSources: TextSourcesList = emptyList(),
|
||||
override val spoilered: Boolean = false,
|
||||
override val quote: TextQuote? = null
|
||||
override val quote: TextQuote? = null,
|
||||
override val showCaptionAboveMedia: Boolean = false
|
||||
) : VisualMediaGroupPartContent {
|
||||
override fun createResend(
|
||||
chatId: ChatIdentifier,
|
||||
@@ -48,5 +49,9 @@ data class VideoContent(
|
||||
|
||||
override fun toMediaGroupMemberTelegramMedia(): TelegramMediaVideo = asTelegramMedia()
|
||||
|
||||
override fun asTelegramMedia(): TelegramMediaVideo = media.toTelegramMediaVideo(textSources)
|
||||
override fun asTelegramMedia(): TelegramMediaVideo = media.toTelegramMediaVideo(
|
||||
textSources = textSources,
|
||||
spoilered = spoilered,
|
||||
showCaptionAboveMedia = showCaptionAboveMedia
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user