2020-10-04 11:06:30 +00:00
|
|
|
package dev.inmo.tgbotapi.types.message.content.media
|
|
|
|
|
|
|
|
import dev.inmo.tgbotapi.requests.abstracts.Request
|
|
|
|
import dev.inmo.tgbotapi.requests.send.media.SendVideo
|
|
|
|
import dev.inmo.tgbotapi.types.ChatIdentifier
|
|
|
|
import dev.inmo.tgbotapi.types.InputMedia.InputMediaVideo
|
2021-05-29 08:31:44 +00:00
|
|
|
import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
2020-10-04 11:06:30 +00:00
|
|
|
import dev.inmo.tgbotapi.types.MessageIdentifier
|
|
|
|
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
|
|
|
import dev.inmo.tgbotapi.types.files.VideoFile
|
2020-11-02 07:16:46 +00:00
|
|
|
import dev.inmo.tgbotapi.types.files.toInputMediaVideo
|
2020-10-04 11:06:30 +00:00
|
|
|
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
2021-06-28 18:06:07 +00:00
|
|
|
import kotlinx.serialization.Serializable
|
2020-10-04 11:06:30 +00:00
|
|
|
|
2021-06-28 18:06:07 +00:00
|
|
|
@Serializable
|
2020-10-04 11:06:30 +00:00
|
|
|
data class VideoContent(
|
|
|
|
override val media: VideoFile,
|
2021-04-26 15:25:52 +00:00
|
|
|
override val text: String? = null,
|
2021-04-27 10:08:36 +00:00
|
|
|
override val textSources: TextSourcesList = emptyList()
|
2022-04-03 13:06:27 +00:00
|
|
|
) : VisualMediaGroupContent, TextedMediaContent {
|
2020-10-04 11:06:30 +00:00
|
|
|
override fun createResend(
|
|
|
|
chatId: ChatIdentifier,
|
|
|
|
disableNotification: Boolean,
|
2022-01-01 14:13:22 +00:00
|
|
|
protectContent: Boolean,
|
2020-10-04 11:06:30 +00:00
|
|
|
replyToMessageId: MessageIdentifier?,
|
2020-11-05 17:48:23 +00:00
|
|
|
allowSendingWithoutReply: Boolean?,
|
2020-10-04 11:06:30 +00:00
|
|
|
replyMarkup: KeyboardMarkup?
|
|
|
|
): Request<ContentMessage<VideoContent>> = SendVideo(
|
|
|
|
chatId,
|
|
|
|
media.fileId,
|
|
|
|
media.thumb ?.fileId,
|
2021-02-09 12:26:10 +00:00
|
|
|
textSources,
|
2020-10-04 11:06:30 +00:00
|
|
|
media.duration,
|
|
|
|
media.width,
|
|
|
|
media.height,
|
|
|
|
null,
|
|
|
|
disableNotification,
|
2022-01-01 14:13:22 +00:00
|
|
|
protectContent,
|
2020-10-04 11:06:30 +00:00
|
|
|
replyToMessageId,
|
2020-11-05 17:48:23 +00:00
|
|
|
allowSendingWithoutReply,
|
2020-10-04 11:06:30 +00:00
|
|
|
replyMarkup
|
|
|
|
)
|
|
|
|
|
2020-11-02 07:16:46 +00:00
|
|
|
override fun toMediaGroupMemberInputMedia(): InputMediaVideo = asInputMedia()
|
2020-10-04 11:06:30 +00:00
|
|
|
|
2021-02-09 12:26:10 +00:00
|
|
|
override fun asInputMedia(): InputMediaVideo = media.toInputMediaVideo(textSources)
|
2020-10-04 11:06:30 +00:00
|
|
|
}
|