1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-03-14 02:22:34 +00:00
This commit is contained in:
InsanusMokrassar 2025-02-15 09:49:18 +06:00
parent 80955eeb55
commit 5a696cdac0
7 changed files with 40 additions and 25 deletions
tgbotapi.core
api
src/commonMain/kotlin/dev/inmo/tgbotapi

@ -5271,7 +5271,7 @@ public final class dev/inmo/tgbotapi/requests/send/SetMessageReactions$Companion
}
public abstract interface class dev/inmo/tgbotapi/requests/send/abstracts/CoveredSendMessageRequest : dev/inmo/tgbotapi/requests/send/abstracts/SendMessageRequest {
public abstract fun getCover ()Ljava/lang/String;
public abstract fun getCover ()Ldev/inmo/tgbotapi/requests/abstracts/InputFile;
}
public final class dev/inmo/tgbotapi/requests/send/abstracts/CoveredSendMessageRequest$DefaultImpls {
@ -6180,7 +6180,7 @@ public final class dev/inmo/tgbotapi/requests/send/media/SendStickerKt {
public final class dev/inmo/tgbotapi/requests/send/media/SendVideoData : dev/inmo/tgbotapi/abstracts/WithCustomStartMediaData, dev/inmo/tgbotapi/requests/send/abstracts/CoveredSendMessageRequest, dev/inmo/tgbotapi/requests/send/abstracts/DuratedSendMessageRequest, dev/inmo/tgbotapi/requests/send/abstracts/OptionallyWithSpoilerRequest, dev/inmo/tgbotapi/requests/send/abstracts/ReplyingMarkupSendMessageRequest, dev/inmo/tgbotapi/requests/send/abstracts/SendContentMessageRequest, dev/inmo/tgbotapi/requests/send/abstracts/SizedSendMessageRequest, dev/inmo/tgbotapi/requests/send/abstracts/TextableSendMessageRequest, dev/inmo/tgbotapi/requests/send/abstracts/ThumbedSendMessageRequest, dev/inmo/tgbotapi/requests/send/abstracts/WithCustomizableCaptionRequest, dev/inmo/tgbotapi/requests/send/media/base/DataRequest {
public static final field Companion Ldev/inmo/tgbotapi/requests/send/media/SendVideoData$Companion;
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ZZLjava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/Integer;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ZZLjava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Ldev/inmo/tgbotapi/types/ChatIdentifier;
public final fun component10 ()Z
public final fun component11 ()Ljava/lang/Long;
@ -6197,19 +6197,19 @@ public final class dev/inmo/tgbotapi/requests/send/media/SendVideoData : dev/inm
public final fun component21 ()Ldev/inmo/tgbotapi/types/ReplyParameters;
public final fun component22 ()Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()Ljava/lang/String;
public final fun component4 ()Ldev/inmo/tgbotapi/requests/abstracts/InputFile;
public final fun component5 ()Ljava/lang/Integer;
public final fun component6 ()Ljava/lang/String;
public final fun component7 ()Ldev/inmo/tgbotapi/types/message/ParseMode;
public final fun component9 ()Z
public final fun copy-2N3v4LM (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ZZLjava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/send/media/SendVideoData;
public static synthetic fun copy-2N3v4LM$default (Ldev/inmo/tgbotapi/requests/send/media/SendVideoData;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ZZLjava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/send/media/SendVideoData;
public final fun copy-2N3v4LM (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/Integer;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ZZLjava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/send/media/SendVideoData;
public static synthetic fun copy-2N3v4LM$default (Ldev/inmo/tgbotapi/requests/send/media/SendVideoData;Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/Integer;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ZZLjava/lang/Long;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/MessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/send/media/SendVideoData;
public fun equals (Ljava/lang/Object;)Z
public fun getAllowPaidBroadcast ()Z
public fun getAllowSendingWithoutReply ()Ljava/lang/Boolean;
public fun getBusinessConnectionId-nXr5wdE ()Ljava/lang/String;
public fun getChatId ()Ldev/inmo/tgbotapi/types/ChatIdentifier;
public fun getCover ()Ljava/lang/String;
public fun getCover ()Ldev/inmo/tgbotapi/requests/abstracts/InputFile;
public fun getDisableNotification ()Z
public fun getDuration ()Ljava/lang/Long;
public fun getEffectId-Ts0V7ak ()Ljava/lang/String;
@ -18019,10 +18019,10 @@ public final class dev/inmo/tgbotapi/types/files/VideoFile$Companion {
}
public final class dev/inmo/tgbotapi/types/files/VideoFileKt {
public static final fun toTelegramMediaVideo (Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZZ)Ldev/inmo/tgbotapi/types/media/TelegramMediaVideo;
public static final fun toTelegramMediaVideo (Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/util/List;ZZ)Ldev/inmo/tgbotapi/types/media/TelegramMediaVideo;
public static synthetic fun toTelegramMediaVideo$default (Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZZILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/TelegramMediaVideo;
public static synthetic fun toTelegramMediaVideo$default (Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/util/List;ZZILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/TelegramMediaVideo;
public static final fun toTelegramMediaVideo (Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZZLjava/lang/Integer;)Ldev/inmo/tgbotapi/types/media/TelegramMediaVideo;
public static final fun toTelegramMediaVideo (Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/util/List;ZZLjava/lang/Integer;)Ldev/inmo/tgbotapi/types/media/TelegramMediaVideo;
public static synthetic fun toTelegramMediaVideo$default (Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZZLjava/lang/Integer;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/TelegramMediaVideo;
public static synthetic fun toTelegramMediaVideo$default (Ldev/inmo/tgbotapi/types/files/VideoFile;Ljava/util/List;ZZLjava/lang/Integer;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/TelegramMediaVideo;
public static final fun toTelegramPaidMediaVideo (Ldev/inmo/tgbotapi/types/files/VideoFile;)Ldev/inmo/tgbotapi/types/media/TelegramPaidMediaVideo;
}
@ -18993,10 +18993,10 @@ public final class dev/inmo/tgbotapi/types/media/TelegramMediaVideo$Companion {
}
public final class dev/inmo/tgbotapi/types/media/TelegramMediaVideoKt {
public static final fun TelegramMediaVideo (Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZZLjava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;)Ldev/inmo/tgbotapi/types/media/TelegramMediaVideo;
public static final fun TelegramMediaVideo (Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;ZZLjava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;)Ldev/inmo/tgbotapi/types/media/TelegramMediaVideo;
public static synthetic fun TelegramMediaVideo$default (Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZZLjava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/TelegramMediaVideo;
public static synthetic fun TelegramMediaVideo$default (Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;ZZLjava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/TelegramMediaVideo;
public static final fun TelegramMediaVideo (Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZZLdev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;)Ldev/inmo/tgbotapi/types/media/TelegramMediaVideo;
public static final fun TelegramMediaVideo (Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;ZZLdev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;)Ldev/inmo/tgbotapi/types/media/TelegramMediaVideo;
public static synthetic fun TelegramMediaVideo$default (Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZZLdev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/TelegramMediaVideo;
public static synthetic fun TelegramMediaVideo$default (Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;ZZLdev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Long;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/TelegramMediaVideo;
}
public abstract interface class dev/inmo/tgbotapi/types/media/TelegramPaidMedia : dev/inmo/tgbotapi/types/media/TelegramMedia {

@ -1,10 +1,8 @@
package dev.inmo.tgbotapi.requests.send.abstracts
import dev.inmo.tgbotapi.requests.abstracts.FileId
import dev.inmo.tgbotapi.requests.abstracts.InputFile
interface CoveredSendMessageRequest<T: Any>: SendMessageRequest<T> {
/**
* Duration of media, usually in seconds
*/
val cover: String?
val cover: InputFile?
}

@ -53,7 +53,7 @@ fun SendVideo(
chatId = chatId,
video = video,
thumbnail = thumbnail ?.fileId,
cover = cover ?.fileId,
cover = cover,
startTimestamp = startTimestamp,
text = text,
parseMode = parseMode,
@ -114,7 +114,7 @@ fun SendVideo(
chatId = chatId,
video = video,
thumbnail = thumbnail ?.fileId,
cover = cover ?.fileId,
cover = cover,
startTimestamp = startTimestamp,
text = entities.makeString(),
parseMode = null,
@ -157,7 +157,7 @@ data class SendVideoData internal constructor(
@SerialName(thumbnailField)
override val thumbnail: String? = null,
@SerialName(coverField)
override val cover: String? = null,
override val cover: InputFile? = null,
@SerialName(startTimestampField)
override val startTimestamp: Seconds? = null,
@SerialName(captionField)

@ -42,13 +42,16 @@ inline fun VideoFile.toTelegramMediaVideo(
text: String? = null,
parseMode: ParseMode? = null,
spoilered: Boolean = false,
showCaptionAboveMedia: Boolean = false
showCaptionAboveMedia: Boolean = false,
startTimestamp: Seconds? = this.startTimestamp
) = TelegramMediaVideo(
file = fileId,
text = text,
parseMode = parseMode,
spoilered = spoilered,
showCaptionAboveMedia = showCaptionAboveMedia,
cover = cover ?.fileId,
startTimestamp = startTimestamp,
width = width,
height = height,
duration = duration,
@ -59,12 +62,15 @@ inline fun VideoFile.toTelegramMediaVideo(
inline fun VideoFile.toTelegramMediaVideo(
textSources: TextSourcesList,
spoilered: Boolean = false,
showCaptionAboveMedia: Boolean = false
showCaptionAboveMedia: Boolean = false,
startTimestamp: Seconds? = this.startTimestamp
) = TelegramMediaVideo(
file = fileId,
entities = textSources,
spoilered = spoilered,
showCaptionAboveMedia = showCaptionAboveMedia,
cover = cover ?.fileId,
startTimestamp = startTimestamp,
width = width,
height = height,
duration = duration,
@ -76,5 +82,7 @@ inline fun VideoFile.toTelegramPaidMediaVideo() = TelegramPaidMediaVideo(
width = width,
height = height,
duration = duration,
cover = cover ?.fileId,
startTimestamp = startTimestamp,
thumb = thumbnail ?.fileId
)

@ -22,6 +22,8 @@ fun TelegramMediaVideo(
parseMode: ParseMode? = null,
spoilered: Boolean = false,
showCaptionAboveMedia: Boolean = false,
cover: InputFile? = null,
startTimestamp: Seconds? = null,
width: Int? = null,
height: Int? = null,
duration: Long? = null,
@ -33,6 +35,8 @@ fun TelegramMediaVideo(
rawEntities = null,
spoilered = spoilered,
showCaptionAboveMedia = showCaptionAboveMedia,
cover = cover,
startTimestamp = startTimestamp,
width = width,
height = height,
duration = duration,
@ -44,6 +48,8 @@ fun TelegramMediaVideo(
entities: TextSourcesList,
spoilered: Boolean = false,
showCaptionAboveMedia: Boolean = false,
cover: InputFile? = null,
startTimestamp: Seconds? = null,
width: Int? = null,
height: Int? = null,
duration: Long? = null,
@ -55,6 +61,8 @@ fun TelegramMediaVideo(
rawEntities = entities.toRawMessageEntities(),
spoilered = spoilered,
showCaptionAboveMedia = showCaptionAboveMedia,
cover = cover,
startTimestamp = startTimestamp,
width = width,
height = height,
duration = duration,

@ -59,6 +59,7 @@ data class VideoContent(
override fun asTelegramMedia(): TelegramMediaVideo = media.toTelegramMediaVideo(
textSources = textSources,
spoilered = spoilered,
showCaptionAboveMedia = showCaptionAboveMedia
showCaptionAboveMedia = showCaptionAboveMedia,
startTimestamp = media.startTimestamp,
)
}

@ -45,6 +45,6 @@ data class VideoNoteContent(
width = media.width,
height = media.height,
duration = media.duration,
thumb = media.thumbnail ?.fileId
thumb = media.thumbnail ?.fileId,
)
}