2018-12-26 08:07:24 +00:00
|
|
|
package com.github.insanusmokrassar.TelegramBotAPI.types.message.content.media
|
|
|
|
|
2019-01-17 02:19:33 +00:00
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
|
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.SendVideoNote
|
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
|
2020-01-20 08:42:38 +00:00
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.InputMediaVideo
|
2019-01-17 02:19:33 +00:00
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
|
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
|
2018-12-26 08:07:24 +00:00
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.files.VideoNoteFile
|
2020-01-15 05:17:53 +00:00
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage
|
2018-12-26 08:07:24 +00:00
|
|
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MediaContent
|
|
|
|
|
|
|
|
data class VideoNoteContent(
|
|
|
|
override val media: VideoNoteFile
|
2019-04-04 14:10:52 +00:00
|
|
|
) : MediaContent {
|
2019-01-17 02:19:33 +00:00
|
|
|
override fun createResend(
|
|
|
|
chatId: ChatIdentifier,
|
|
|
|
disableNotification: Boolean,
|
|
|
|
replyToMessageId: MessageIdentifier?,
|
|
|
|
replyMarkup: KeyboardMarkup?
|
2020-01-15 05:17:53 +00:00
|
|
|
): Request<ContentMessage<VideoNoteContent>> = createResend(chatId, null, null, disableNotification, replyToMessageId, replyMarkup)
|
2019-01-17 02:19:33 +00:00
|
|
|
|
|
|
|
fun createResend(
|
|
|
|
chatId: ChatIdentifier,
|
|
|
|
caption: String?,
|
|
|
|
parseMode: ParseMode? = null,
|
|
|
|
disableNotification: Boolean = false,
|
|
|
|
replyToMessageId: MessageIdentifier? = null,
|
|
|
|
replyMarkup: KeyboardMarkup? = null
|
2020-01-15 05:17:53 +00:00
|
|
|
): Request<ContentMessage<VideoNoteContent>> = SendVideoNote(
|
2019-01-17 02:19:33 +00:00
|
|
|
chatId,
|
|
|
|
media.fileId,
|
|
|
|
media.thumb ?.fileId,
|
|
|
|
caption,
|
|
|
|
parseMode,
|
|
|
|
media.duration,
|
|
|
|
media.width,
|
|
|
|
disableNotification,
|
|
|
|
replyToMessageId,
|
|
|
|
replyMarkup
|
|
|
|
)
|
2020-01-20 08:42:38 +00:00
|
|
|
|
|
|
|
override fun asInputMedia(): InputMediaVideo = InputMediaVideo(
|
|
|
|
media.fileId,
|
|
|
|
width = media.width,
|
|
|
|
height = media.height,
|
|
|
|
duration = media.duration,
|
|
|
|
thumb = media.thumb ?.fileId
|
|
|
|
)
|
2019-01-17 02:19:33 +00:00
|
|
|
}
|