mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2026-03-22 10:45:02 +00:00
fix of #1026
This commit is contained in:
@@ -13,6 +13,7 @@ import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.message.ParseMode
|
||||
import dev.inmo.tgbotapi.types.message.parseModeField
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.media.OptionallyStreamable
|
||||
import dev.inmo.tgbotapi.types.message.*
|
||||
import dev.inmo.tgbotapi.types.message.RawMessageEntity
|
||||
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
|
||||
@@ -37,7 +38,7 @@ fun SendVideo(
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
supportStreaming: Boolean? = null,
|
||||
supportsStreaming: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@@ -67,7 +68,7 @@ fun SendVideo(
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
supportStreaming = supportStreaming,
|
||||
supportsStreaming = supportsStreaming,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
@@ -102,7 +103,7 @@ fun SendVideo(
|
||||
duration: Long? = null,
|
||||
width: Int? = null,
|
||||
height: Int? = null,
|
||||
supportStreaming: Boolean? = null,
|
||||
supportsStreaming: Boolean = false,
|
||||
threadId: MessageThreadId? = chatId.threadId,
|
||||
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
|
||||
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
|
||||
@@ -132,7 +133,7 @@ fun SendVideo(
|
||||
duration = duration,
|
||||
width = width,
|
||||
height = height,
|
||||
supportStreaming = supportStreaming,
|
||||
supportsStreaming = supportsStreaming,
|
||||
threadId = threadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
@@ -188,7 +189,7 @@ data class SendVideoData internal constructor(
|
||||
@SerialName(heightField)
|
||||
override val height: Int? = null,
|
||||
@SerialName(supportStreamingField)
|
||||
val supportStreaming: Boolean? = null,
|
||||
override val supportsStreaming: Boolean = false,
|
||||
@OptIn(ExperimentalSerializationApi::class)
|
||||
@SerialName(messageThreadIdField)
|
||||
@EncodeDefault
|
||||
@@ -223,7 +224,8 @@ data class SendVideoData internal constructor(
|
||||
WithCustomizableCaptionRequest<ContentMessage<VideoContent>>,
|
||||
CoveredSendMessageRequest<ContentMessage<VideoContent>>,
|
||||
WithCustomStartMediaData,
|
||||
OptionallyWithSpoilerRequest
|
||||
OptionallyWithSpoilerRequest,
|
||||
OptionallyStreamable
|
||||
{
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
rawEntities ?.asTextSources(text ?: return@lazy null)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
package dev.inmo.tgbotapi.types.media
|
||||
|
||||
interface OptionallyStreamable {
|
||||
val supportsStreaming: Boolean
|
||||
}
|
||||
@@ -90,13 +90,16 @@ data class TelegramMediaVideo internal constructor (
|
||||
override val width: Int? = null,
|
||||
override val height: Int? = null,
|
||||
override val duration: Long? = null,
|
||||
override val thumb: InputFile? = null
|
||||
override val thumb: InputFile? = null,
|
||||
@SerialName(supportsStreamingField)
|
||||
override val supportsStreaming: Boolean = false,
|
||||
) : TelegramFreeMedia,
|
||||
SizedTelegramMedia,
|
||||
DuratedTelegramMedia,
|
||||
ThumbedTelegramMedia,
|
||||
CoveredTelegramMedia,
|
||||
WithCustomStartTelegramMedia,
|
||||
OptionallyStreamable,
|
||||
VisualMediaGroupMemberTelegramMedia {
|
||||
override val type: String = videoTelegramMediaType
|
||||
override val textSources: TextSourcesList? by lazy {
|
||||
|
||||
@@ -17,7 +17,7 @@ data class TelegramPaidMediaVideo (
|
||||
override val height: Int? = null,
|
||||
override val duration: Long? = null,
|
||||
@SerialName(supportsStreamingField)
|
||||
val supportsStreaming: Boolean = false,
|
||||
override val supportsStreaming: Boolean = false,
|
||||
@SerialName(coverField)
|
||||
override val cover: InputFile? = null,
|
||||
@SerialName(startTimestampField)
|
||||
@@ -27,6 +27,7 @@ data class TelegramPaidMediaVideo (
|
||||
DuratedTelegramMedia,
|
||||
ThumbedTelegramMedia,
|
||||
CoveredTelegramMedia,
|
||||
OptionallyStreamable,
|
||||
WithCustomStartTelegramMedia {
|
||||
override val type: String = videoTelegramPaidMediaType
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ data class VideoContent(
|
||||
duration = media.duration,
|
||||
width = media.width,
|
||||
height = media.height,
|
||||
supportStreaming = null,
|
||||
supportsStreaming = false,
|
||||
threadId = messageThreadId,
|
||||
directMessageThreadId = directMessageThreadId,
|
||||
businessConnectionId = businessConnectionId,
|
||||
|
||||
Reference in New Issue
Block a user