1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2026-05-26 02:07:22 +00:00

add LivePhotos support

This commit is contained in:
2026-05-17 16:43:18 +06:00
parent f3f28b6165
commit d47641c39a
41 changed files with 2135 additions and 13 deletions

View File

@@ -7158,6 +7158,126 @@ public final class dev/inmo/tgbotapi/requests/send/media/SendDocumentKt {
public static synthetic fun SendDocument-kPvWKIg$default (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;Ljava/lang/Boolean;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/abstracts/Request;
}
public final class dev/inmo/tgbotapi/requests/send/media/SendLivePhotoData : 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/TextableSendMessageRequest, 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/SendLivePhotoData$Companion;
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;Ljava/util/List;ZZLdev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;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-1osv_qQ ()Ldev/inmo/tgbotapi/types/DirectMessageThreadId;
public final fun component11-nXr5wdE ()Ljava/lang/String;
public final fun component12 ()Z
public final fun component13 ()Z
public final fun component14 ()Z
public final fun component15-Ts0V7ak ()Ljava/lang/String;
public final fun component16 ()Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;
public final fun component17 ()Ldev/inmo/tgbotapi/types/ReplyParameters;
public final fun component18 ()Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;
public final fun component2 ()Ldev/inmo/tgbotapi/requests/abstracts/InputFile;
public final fun component3 ()Ldev/inmo/tgbotapi/requests/abstracts/InputFile;
public final fun component4 ()Ljava/lang/String;
public final fun component5 ()Ldev/inmo/tgbotapi/types/message/ParseMode;
public final fun component7 ()Z
public final fun component8 ()Z
public final fun component9-S3HF-10 ()Ldev/inmo/tgbotapi/types/MessageThreadId;
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 getDirectMessageThreadId-1osv_qQ ()Ldev/inmo/tgbotapi/types/DirectMessageThreadId;
public fun getDisableNotification ()Z
public fun getEffectId-Ts0V7ak ()Ljava/lang/String;
public fun getEntities ()Ljava/util/List;
public final fun getLivePhoto ()Ldev/inmo/tgbotapi/requests/abstracts/InputFile;
public fun getParseMode ()Ldev/inmo/tgbotapi/types/message/ParseMode;
public final fun getPhoto ()Ldev/inmo/tgbotapi/requests/abstracts/InputFile;
public fun getProtectContent ()Z
public fun getReplyMarkup ()Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;
public fun getReplyParameters ()Ldev/inmo/tgbotapi/types/ReplyParameters;
public fun getReplyToMessageId-CigXjpw ()Ldev/inmo/tgbotapi/types/MessageId;
public fun getRequestSerializer ()Lkotlinx/serialization/SerializationStrategy;
public fun getResultDeserializer ()Lkotlinx/serialization/DeserializationStrategy;
public fun getShowCaptionAboveMedia ()Z
public fun getSpoilered ()Z
public fun getSuggestedPostParameters ()Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;
public fun getText ()Ljava/lang/String;
public fun getTextSources ()Ljava/util/List;
public fun getThreadId-S3HF-10 ()Ldev/inmo/tgbotapi/types/MessageThreadId;
public fun hashCode ()I
public fun method ()Ljava/lang/String;
public fun toString ()Ljava/lang/String;
}
public final synthetic class dev/inmo/tgbotapi/requests/send/media/SendLivePhotoData$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Ldev/inmo/tgbotapi/requests/send/media/SendLivePhotoData$$serializer;
public final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/requests/send/media/SendLivePhotoData;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/requests/send/media/SendLivePhotoData;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/requests/send/media/SendLivePhotoData$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/requests/send/media/SendLivePhotoFiles : java/util/Map, kotlin/jvm/internal/markers/KMappedMarker {
public fun <init> ()V
public fun clear ()V
public final fun component1 ()Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;
public final fun component2 ()Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;
public synthetic fun compute (Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;
public fun compute (Ljava/lang/String;Ljava/util/function/BiFunction;)Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;
public synthetic fun computeIfAbsent (Ljava/lang/Object;Ljava/util/function/Function;)Ljava/lang/Object;
public fun computeIfAbsent (Ljava/lang/String;Ljava/util/function/Function;)Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;
public synthetic fun computeIfPresent (Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;
public fun computeIfPresent (Ljava/lang/String;Ljava/util/function/BiFunction;)Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;
public final fun containsKey (Ljava/lang/Object;)Z
public fun containsKey (Ljava/lang/String;)Z
public fun containsValue (Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;)Z
public final fun containsValue (Ljava/lang/Object;)Z
public final fun entrySet ()Ljava/util/Set;
public fun equals (Ljava/lang/Object;)Z
public final fun get (Ljava/lang/Object;)Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;
public final synthetic fun get (Ljava/lang/Object;)Ljava/lang/Object;
public fun get (Ljava/lang/String;)Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;
public fun getEntries ()Ljava/util/Set;
public fun getKeys ()Ljava/util/Set;
public final fun getLivePhoto ()Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;
public final fun getPhoto ()Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;
public fun getSize ()I
public fun getValues ()Ljava/util/Collection;
public fun hashCode ()I
public fun isEmpty ()Z
public final fun keySet ()Ljava/util/Set;
public synthetic fun merge (Ljava/lang/Object;Ljava/lang/Object;Ljava/util/function/BiFunction;)Ljava/lang/Object;
public fun merge (Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;Ljava/util/function/BiFunction;)Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;
public synthetic fun put (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
public fun put (Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;)Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;
public fun putAll (Ljava/util/Map;)V
public synthetic fun putIfAbsent (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
public fun putIfAbsent (Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;)Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;
public fun remove (Ljava/lang/Object;)Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;
public synthetic fun remove (Ljava/lang/Object;)Ljava/lang/Object;
public fun remove (Ljava/lang/Object;Ljava/lang/Object;)Z
public synthetic fun replace (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;
public synthetic fun replace (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z
public fun replace (Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;)Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;
public fun replace (Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;)Z
public fun replaceAll (Ljava/util/function/BiFunction;)V
public final fun size ()I
public fun toString ()Ljava/lang/String;
public final fun values ()Ljava/util/Collection;
}
public final class dev/inmo/tgbotapi/requests/send/media/SendLivePhotoKt {
public static final fun SendLivePhoto-1Q0j7Ys (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;ZZLdev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/abstracts/Request;
public static synthetic fun SendLivePhoto-1Q0j7Ys$default (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;ZZLdev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/abstracts/Request;
public static final fun SendLivePhoto-qp0sMgg (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZZLdev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/abstracts/Request;
public static synthetic fun SendLivePhoto-qp0sMgg$default (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZZLdev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;ILjava/lang/Object;)Ldev/inmo/tgbotapi/requests/abstracts/Request;
}
public final class dev/inmo/tgbotapi/requests/send/media/SendMediaGroupData : dev/inmo/tgbotapi/requests/send/abstracts/SendContentMessageRequest, dev/inmo/tgbotapi/requests/send/media/base/DataRequest {
public static final field Companion Ldev/inmo/tgbotapi/requests/send/media/SendMediaGroupData$Companion;
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ljava/util/List;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
@@ -10945,6 +11065,7 @@ public final class dev/inmo/tgbotapi/types/CommonKt {
public static final field linkPreviewOptionsField Ljava/lang/String;
public static final field linkedChatIdField Ljava/lang/String;
public static final field livePeriodField Ljava/lang/String;
public static final field livePhotoField Ljava/lang/String;
public static final field locationField Ljava/lang/String;
public static final field loginUrlField Ljava/lang/String;
public static final field longitudeField Ljava/lang/String;
@@ -21172,6 +21293,56 @@ public final class dev/inmo/tgbotapi/types/files/FileSize$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/files/LivePhotoFile : dev/inmo/tgbotapi/types/files/MediaContentVariant, dev/inmo/tgbotapi/types/files/MimedMediaFile, dev/inmo/tgbotapi/types/files/PlayableMediaFile, dev/inmo/tgbotapi/types/files/SizedMediaFile, dev/inmo/tgbotapi/types/files/TelegramMediaFile, dev/inmo/tgbotapi/types/files/UsefulAsPaidMediaFile, dev/inmo/tgbotapi/types/media/PollMedia {
public static final field Companion Ldev/inmo/tgbotapi/types/files/LivePhotoFile$Companion;
public synthetic fun <init> (Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ljava/lang/String;IIJLjava/util/List;Ldev/inmo/tgbotapi/utils/MimeType;Ldev/inmo/tgbotapi/types/files/FileSize;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ljava/lang/String;IIJLjava/util/List;Ldev/inmo/tgbotapi/utils/MimeType;Ldev/inmo/tgbotapi/types/files/FileSize;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Ldev/inmo/tgbotapi/requests/abstracts/FileId;
public final fun component2-lakR5NQ ()Ljava/lang/String;
public final fun component3 ()I
public final fun component4 ()I
public final fun component5 ()J
public final fun component6-oW4O2Ik ()Ljava/util/List;
public final fun component7 ()Ldev/inmo/tgbotapi/utils/MimeType;
public final fun component8-yrF3Zgw ()Ldev/inmo/tgbotapi/types/files/FileSize;
public final fun copy-vFT_IfY (Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ljava/lang/String;IIJLjava/util/List;Ldev/inmo/tgbotapi/utils/MimeType;Ldev/inmo/tgbotapi/types/files/FileSize;)Ldev/inmo/tgbotapi/types/files/LivePhotoFile;
public static synthetic fun copy-vFT_IfY$default (Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ljava/lang/String;IIJLjava/util/List;Ldev/inmo/tgbotapi/utils/MimeType;Ldev/inmo/tgbotapi/types/files/FileSize;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/files/LivePhotoFile;
public fun equals (Ljava/lang/Object;)Z
public fun getDuration ()Ljava/lang/Long;
public fun getFileId ()Ldev/inmo/tgbotapi/requests/abstracts/FileId;
public fun getFileSize-yrF3Zgw ()Ldev/inmo/tgbotapi/types/files/FileSize;
public fun getFileUniqueId-lakR5NQ ()Ljava/lang/String;
public fun getHeight ()I
public fun getMimeType ()Ldev/inmo/tgbotapi/utils/MimeType;
public final fun getPhoto-oW4O2Ik ()Ljava/util/List;
public fun getWidth ()I
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final synthetic class dev/inmo/tgbotapi/types/files/LivePhotoFile$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Ldev/inmo/tgbotapi/types/files/LivePhotoFile$$serializer;
public final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/files/LivePhotoFile;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/files/LivePhotoFile;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/files/LivePhotoFile$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/files/LivePhotoFileKt {
public static final fun toTelegramMediaLivePhoto (Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZZ)Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto;
public static final fun toTelegramMediaLivePhoto (Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/util/List;ZZ)Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto;
public static synthetic fun toTelegramMediaLivePhoto$default (Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZZILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto;
public static synthetic fun toTelegramMediaLivePhoto$default (Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/util/List;ZZILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto;
public static final fun toTelegramPaidMediaLivePhoto (Ldev/inmo/tgbotapi/types/files/LivePhotoFile;)Ldev/inmo/tgbotapi/types/media/TelegramPaidMediaLivePhoto;
}
public final class dev/inmo/tgbotapi/types/files/MaskAnimatedSticker : dev/inmo/tgbotapi/types/files/AnimatedSticker, dev/inmo/tgbotapi/types/files/MaskSticker {
public static final field Companion Ldev/inmo/tgbotapi/types/files/MaskAnimatedSticker$Companion;
public synthetic fun <init> (Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ljava/lang/String;IILdev/inmo/tgbotapi/types/stickers/MaskPosition;Ldev/inmo/tgbotapi/types/files/PhotoSize;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/files/FileSize;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
@@ -23959,22 +24130,24 @@ public final class dev/inmo/tgbotapi/types/media/PollMedia$Serializer : kotlinx/
public final class dev/inmo/tgbotapi/types/media/PollMedia$Serializer$Surrogate {
public static final field Companion Ldev/inmo/tgbotapi/types/media/PollMedia$Serializer$Surrogate$Companion;
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/files/DocumentFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/files/Sticker;Ldev/inmo/tgbotapi/types/files/VideoFile;Ldev/inmo/tgbotapi/types/location/StaticLocation;Ldev/inmo/tgbotapi/types/venue/Venue;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/files/DocumentFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/files/Sticker;Ldev/inmo/tgbotapi/types/files/VideoFile;Ldev/inmo/tgbotapi/types/location/StaticLocation;Ldev/inmo/tgbotapi/types/venue/Venue;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/files/DocumentFile;Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/files/Sticker;Ldev/inmo/tgbotapi/types/files/VideoFile;Ldev/inmo/tgbotapi/types/location/StaticLocation;Ldev/inmo/tgbotapi/types/venue/Venue;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/files/DocumentFile;Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/files/Sticker;Ldev/inmo/tgbotapi/types/files/VideoFile;Ldev/inmo/tgbotapi/types/location/StaticLocation;Ldev/inmo/tgbotapi/types/venue/Venue;Lkotlin/jvm/internal/DefaultConstructorMarker;)V
public final fun component1 ()Ldev/inmo/tgbotapi/types/files/AnimationFile;
public final fun component2 ()Ldev/inmo/tgbotapi/types/files/AudioFile;
public final fun component3 ()Ldev/inmo/tgbotapi/types/files/DocumentFile;
public final fun component4-oW4O2Ik ()Ljava/util/List;
public final fun component5 ()Ldev/inmo/tgbotapi/types/files/Sticker;
public final fun component6 ()Ldev/inmo/tgbotapi/types/files/VideoFile;
public final fun component7 ()Ldev/inmo/tgbotapi/types/location/StaticLocation;
public final fun component8 ()Ldev/inmo/tgbotapi/types/venue/Venue;
public final fun copy-ptgU2C0 (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/files/DocumentFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/files/Sticker;Ldev/inmo/tgbotapi/types/files/VideoFile;Ldev/inmo/tgbotapi/types/location/StaticLocation;Ldev/inmo/tgbotapi/types/venue/Venue;)Ldev/inmo/tgbotapi/types/media/PollMedia$Serializer$Surrogate;
public static synthetic fun copy-ptgU2C0$default (Ldev/inmo/tgbotapi/types/media/PollMedia$Serializer$Surrogate;Ldev/inmo/tgbotapi/types/files/AnimationFile;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/files/DocumentFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/files/Sticker;Ldev/inmo/tgbotapi/types/files/VideoFile;Ldev/inmo/tgbotapi/types/location/StaticLocation;Ldev/inmo/tgbotapi/types/venue/Venue;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/PollMedia$Serializer$Surrogate;
public final fun component4 ()Ldev/inmo/tgbotapi/types/files/LivePhotoFile;
public final fun component5-oW4O2Ik ()Ljava/util/List;
public final fun component6 ()Ldev/inmo/tgbotapi/types/files/Sticker;
public final fun component7 ()Ldev/inmo/tgbotapi/types/files/VideoFile;
public final fun component8 ()Ldev/inmo/tgbotapi/types/location/StaticLocation;
public final fun component9 ()Ldev/inmo/tgbotapi/types/venue/Venue;
public final fun copy-B73X2Os (Ldev/inmo/tgbotapi/types/files/AnimationFile;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/files/DocumentFile;Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/files/Sticker;Ldev/inmo/tgbotapi/types/files/VideoFile;Ldev/inmo/tgbotapi/types/location/StaticLocation;Ldev/inmo/tgbotapi/types/venue/Venue;)Ldev/inmo/tgbotapi/types/media/PollMedia$Serializer$Surrogate;
public static synthetic fun copy-B73X2Os$default (Ldev/inmo/tgbotapi/types/media/PollMedia$Serializer$Surrogate;Ldev/inmo/tgbotapi/types/files/AnimationFile;Ldev/inmo/tgbotapi/types/files/AudioFile;Ldev/inmo/tgbotapi/types/files/DocumentFile;Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/files/Sticker;Ldev/inmo/tgbotapi/types/files/VideoFile;Ldev/inmo/tgbotapi/types/location/StaticLocation;Ldev/inmo/tgbotapi/types/venue/Venue;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/PollMedia$Serializer$Surrogate;
public fun equals (Ljava/lang/Object;)Z
public final fun getAnimation ()Ldev/inmo/tgbotapi/types/files/AnimationFile;
public final fun getAudio ()Ldev/inmo/tgbotapi/types/files/AudioFile;
public final fun getDocument ()Ldev/inmo/tgbotapi/types/files/DocumentFile;
public final fun getLivePhoto ()Ldev/inmo/tgbotapi/types/files/LivePhotoFile;
public final fun getLocation ()Ldev/inmo/tgbotapi/types/location/StaticLocation;
public final fun getPhoto-oW4O2Ik ()Ljava/util/List;
public final fun getSticker ()Ldev/inmo/tgbotapi/types/files/Sticker;
@@ -24180,6 +24353,53 @@ public final class dev/inmo/tgbotapi/types/media/TelegramMediaDocumentKt {
public static synthetic fun toTelegramMediaDocument$default (Ldev/inmo/tgbotapi/types/files/DocumentFile;Ljava/util/List;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/TelegramMediaDocument;
}
public final class dev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto : dev/inmo/tgbotapi/types/media/InputPollMedia, dev/inmo/tgbotapi/types/media/InputPollOptionMedia, dev/inmo/tgbotapi/types/media/TelegramFreeMedia, dev/inmo/tgbotapi/types/media/VisualMediaGroupMemberTelegramMedia {
public static final field Companion Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto$Companion;
public static final field TYPE Ljava/lang/String;
public final fun component1 ()Ldev/inmo/tgbotapi/requests/abstracts/InputFile;
public final fun component2 ()Ldev/inmo/tgbotapi/requests/abstracts/InputFile;
public final fun component3 ()Ljava/lang/String;
public final fun component4 ()Ldev/inmo/tgbotapi/types/message/ParseMode;
public final fun component6 ()Z
public final fun component7 ()Z
public fun equals (Ljava/lang/Object;)Z
public fun getEntities ()Ljava/util/List;
public fun getFile ()Ldev/inmo/tgbotapi/requests/abstracts/InputFile;
public fun getMedia ()Ljava/lang/String;
public fun getParseMode ()Ldev/inmo/tgbotapi/types/message/ParseMode;
public final fun getPhoto ()Ldev/inmo/tgbotapi/requests/abstracts/InputFile;
public fun getShowCaptionAboveMedia ()Z
public fun getSpoilered ()Z
public fun getText ()Ljava/lang/String;
public fun getTextSources ()Ljava/util/List;
public fun getType ()Ljava/lang/String;
public fun hashCode ()I
public fun serialize (Lkotlinx/serialization/StringFormat;)Ljava/lang/String;
public fun toString ()Ljava/lang/String;
}
public final synthetic class dev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto$$serializer;
public final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/media/TelegramMediaLivePhotoKt {
public static final fun TelegramMediaLivePhoto (Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZZ)Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto;
public static final fun TelegramMediaLivePhoto (Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;ZZ)Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto;
public static synthetic fun TelegramMediaLivePhoto$default (Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/lang/String;Ldev/inmo/tgbotapi/types/message/ParseMode;ZZILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto;
public static synthetic fun TelegramMediaLivePhoto$default (Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;ZZILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto;
}
public final class dev/inmo/tgbotapi/types/media/TelegramMediaLocation : dev/inmo/tgbotapi/abstracts/HorizontallyAccured, dev/inmo/tgbotapi/abstracts/Locationed, dev/inmo/tgbotapi/types/media/InputPollMedia, dev/inmo/tgbotapi/types/media/InputPollOptionMedia {
public static final field Companion Ldev/inmo/tgbotapi/types/media/TelegramMediaLocation$Companion;
public static final field TYPE Ljava/lang/String;
@@ -24413,6 +24633,42 @@ public final class dev/inmo/tgbotapi/types/media/TelegramPaidMedia$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/media/TelegramPaidMediaLivePhoto : dev/inmo/tgbotapi/types/media/VisualTelegramPaidMedia {
public static final field Companion Ldev/inmo/tgbotapi/types/media/TelegramPaidMediaLivePhoto$Companion;
public static final field TYPE Ljava/lang/String;
public fun <init> (Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;)V
public final fun component1 ()Ldev/inmo/tgbotapi/requests/abstracts/InputFile;
public final fun component2 ()Ldev/inmo/tgbotapi/requests/abstracts/InputFile;
public final fun copy (Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;)Ldev/inmo/tgbotapi/types/media/TelegramPaidMediaLivePhoto;
public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/media/TelegramPaidMediaLivePhoto;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/media/TelegramPaidMediaLivePhoto;
public fun equals (Ljava/lang/Object;)Z
public fun getFile ()Ldev/inmo/tgbotapi/requests/abstracts/InputFile;
public fun getMedia ()Ljava/lang/String;
public final fun getPhoto ()Ldev/inmo/tgbotapi/requests/abstracts/InputFile;
public fun getType ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final synthetic class dev/inmo/tgbotapi/types/media/TelegramPaidMediaLivePhoto$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Ldev/inmo/tgbotapi/types/media/TelegramPaidMediaLivePhoto$$serializer;
public final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/media/TelegramPaidMediaLivePhoto;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/media/TelegramPaidMediaLivePhoto;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/media/TelegramPaidMediaLivePhoto$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/media/TelegramPaidMediaLivePhotoKt {
public static final fun toTelegramPaidMediaLivePhoto (Ldev/inmo/tgbotapi/types/message/payments/PaidMedia$LivePhoto;)Ldev/inmo/tgbotapi/types/media/TelegramPaidMediaLivePhoto;
}
public final class dev/inmo/tgbotapi/types/media/TelegramPaidMediaPhoto : dev/inmo/tgbotapi/types/media/VisualTelegramPaidMedia {
public static final field Companion Ldev/inmo/tgbotapi/types/media/TelegramPaidMediaPhoto$Companion;
public static final field TYPE Ljava/lang/String;
@@ -27843,6 +28099,52 @@ public final class dev/inmo/tgbotapi/types/message/content/LiveLocationContent$C
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/message/content/LivePhotoContent : dev/inmo/tgbotapi/types/message/content/VisualMediaGroupPartContent {
public static final field Companion Ldev/inmo/tgbotapi/types/message/content/LivePhotoContent$Companion;
public fun <init> (Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/lang/String;Ljava/util/List;ZLdev/inmo/tgbotapi/types/TextQuote;Z)V
public synthetic fun <init> (Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/lang/String;Ljava/util/List;ZLdev/inmo/tgbotapi/types/TextQuote;ZILkotlin/jvm/internal/DefaultConstructorMarker;)V
public synthetic fun asTelegramMedia ()Ldev/inmo/tgbotapi/types/media/TelegramFreeMedia;
public fun asTelegramMedia ()Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto;
public final fun component1 ()Ldev/inmo/tgbotapi/types/files/LivePhotoFile;
public final fun component2 ()Ljava/lang/String;
public final fun component3 ()Ljava/util/List;
public final fun component4 ()Z
public final fun component5 ()Ldev/inmo/tgbotapi/types/TextQuote;
public final fun component6 ()Z
public final fun copy (Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/lang/String;Ljava/util/List;ZLdev/inmo/tgbotapi/types/TextQuote;Z)Ldev/inmo/tgbotapi/types/message/content/LivePhotoContent;
public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/message/content/LivePhotoContent;Ldev/inmo/tgbotapi/types/files/LivePhotoFile;Ljava/lang/String;Ljava/util/List;ZLdev/inmo/tgbotapi/types/TextQuote;ZILjava/lang/Object;)Ldev/inmo/tgbotapi/types/message/content/LivePhotoContent;
public fun createResend-QiyHKDI (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/MessageId;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/abstracts/Request;
public fun createResend-eUDkMIk (Ldev/inmo/tgbotapi/types/ChatIdentifier;Ldev/inmo/tgbotapi/types/MessageThreadId;Ldev/inmo/tgbotapi/types/DirectMessageThreadId;Ljava/lang/String;ZZZLjava/lang/String;Ldev/inmo/tgbotapi/types/message/SuggestedPostParameters;Ldev/inmo/tgbotapi/types/ReplyParameters;Ldev/inmo/tgbotapi/types/buttons/KeyboardMarkup;)Ldev/inmo/tgbotapi/requests/abstracts/Request;
public fun equals (Ljava/lang/Object;)Z
public fun getMedia ()Ldev/inmo/tgbotapi/types/files/LivePhotoFile;
public synthetic fun getMedia ()Ldev/inmo/tgbotapi/types/files/TelegramMediaFile;
public fun getQuote ()Ldev/inmo/tgbotapi/types/TextQuote;
public fun getShowCaptionAboveMedia ()Z
public fun getSpoilered ()Z
public fun getText ()Ljava/lang/String;
public fun getTextSources ()Ljava/util/List;
public fun hashCode ()I
public synthetic fun toMediaGroupMemberTelegramMedia ()Ldev/inmo/tgbotapi/types/media/MediaGroupMemberTelegramMedia;
public fun toMediaGroupMemberTelegramMedia ()Ldev/inmo/tgbotapi/types/media/TelegramMediaLivePhoto;
public synthetic fun toMediaGroupMemberTelegramMedia ()Ldev/inmo/tgbotapi/types/media/VisualMediaGroupMemberTelegramMedia;
public fun toString ()Ljava/lang/String;
}
public final synthetic class dev/inmo/tgbotapi/types/message/content/LivePhotoContent$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Ldev/inmo/tgbotapi/types/message/content/LivePhotoContent$$serializer;
public final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/message/content/LivePhotoContent;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/message/content/LivePhotoContent;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/message/content/LivePhotoContent$Companion {
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public abstract interface class dev/inmo/tgbotapi/types/message/content/LocationContent : dev/inmo/tgbotapi/types/message/content/MessageContent {
public static final field Companion Ldev/inmo/tgbotapi/types/message/content/LocationContent$Companion;
public fun copy (Ldev/inmo/tgbotapi/types/location/Location;)V
@@ -28438,6 +28740,35 @@ public final class dev/inmo/tgbotapi/types/message/payments/PaidMedia$Companion
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/message/payments/PaidMedia$LivePhoto : dev/inmo/tgbotapi/types/message/payments/PaidMedia {
public static final field Companion Ldev/inmo/tgbotapi/types/message/payments/PaidMedia$LivePhoto$Companion;
public fun <init> (Ldev/inmo/tgbotapi/types/files/LivePhotoFile;)V
public final fun component1 ()Ldev/inmo/tgbotapi/types/files/LivePhotoFile;
public final fun copy (Ldev/inmo/tgbotapi/types/files/LivePhotoFile;)Ldev/inmo/tgbotapi/types/message/payments/PaidMedia$LivePhoto;
public static synthetic fun copy$default (Ldev/inmo/tgbotapi/types/message/payments/PaidMedia$LivePhoto;Ldev/inmo/tgbotapi/types/files/LivePhotoFile;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/message/payments/PaidMedia$LivePhoto;
public fun equals (Ljava/lang/Object;)Z
public final fun getLivePhoto ()Ldev/inmo/tgbotapi/types/files/LivePhotoFile;
public fun getType ()Ljava/lang/String;
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
}
public final synthetic class dev/inmo/tgbotapi/types/message/payments/PaidMedia$LivePhoto$$serializer : kotlinx/serialization/internal/GeneratedSerializer {
public static final field INSTANCE Ldev/inmo/tgbotapi/types/message/payments/PaidMedia$LivePhoto$$serializer;
public final fun childSerializers ()[Lkotlinx/serialization/KSerializer;
public final fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ldev/inmo/tgbotapi/types/message/payments/PaidMedia$LivePhoto;
public synthetic fun deserialize (Lkotlinx/serialization/encoding/Decoder;)Ljava/lang/Object;
public final fun getDescriptor ()Lkotlinx/serialization/descriptors/SerialDescriptor;
public final fun serialize (Lkotlinx/serialization/encoding/Encoder;Ldev/inmo/tgbotapi/types/message/payments/PaidMedia$LivePhoto;)V
public synthetic fun serialize (Lkotlinx/serialization/encoding/Encoder;Ljava/lang/Object;)V
public fun typeParametersSerializers ()[Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/message/payments/PaidMedia$LivePhoto$Companion {
public final fun getType ()Ljava/lang/String;
public final fun serializer ()Lkotlinx/serialization/KSerializer;
}
public final class dev/inmo/tgbotapi/types/message/payments/PaidMedia$Photo : dev/inmo/tgbotapi/types/message/payments/PaidMedia {
public static final field Companion Ldev/inmo/tgbotapi/types/message/payments/PaidMedia$Photo$Companion;
public synthetic fun <init> (Ljava/util/List;Lkotlin/jvm/internal/DefaultConstructorMarker;)V

View File

@@ -0,0 +1,211 @@
@file:Suppress("FunctionName")
package dev.inmo.tgbotapi.requests.send.media
import dev.inmo.tgbotapi.requests.abstracts.*
import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
import dev.inmo.tgbotapi.requests.send.abstracts.*
import dev.inmo.tgbotapi.requests.send.media.base.*
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
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.message.*
import dev.inmo.tgbotapi.types.message.RawMessageEntity
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
import dev.inmo.tgbotapi.types.message.content.LivePhotoContent
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
import dev.inmo.tgbotapi.utils.extensions.makeString
import dev.inmo.tgbotapi.utils.mapOfNotNull
import dev.inmo.tgbotapi.utils.throwRangeError
import kotlinx.serialization.*
fun SendLivePhoto(
chatId: ChatIdentifier,
livePhoto: InputFile,
photo: InputFile,
text: String? = null,
parseMode: ParseMode? = null,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<LivePhotoContent>> {
val livePhotoAsFile = livePhoto as? MultipartFile
val photoAsFile = photo as? MultipartFile
val data = SendLivePhotoData(
chatId = chatId,
livePhoto = livePhoto,
photo = photo,
text = text,
parseMode = parseMode,
rawEntities = null,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
return if (livePhotoAsFile == null && photoAsFile == null) {
data
} else {
CommonMultipartFileRequest(
data,
listOfNotNull(livePhotoAsFile, photoAsFile).associateBy { it.fileId }
)
}
}
fun SendLivePhoto(
chatId: ChatIdentifier,
livePhoto: InputFile,
photo: InputFile,
entities: TextSourcesList,
showCaptionAboveMedia: Boolean = false,
spoilered: Boolean = false,
threadId: MessageThreadId? = chatId.threadId,
directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowPaidBroadcast: Boolean = false,
effectId: EffectId? = null,
suggestedPostParameters: SuggestedPostParameters? = null,
replyParameters: ReplyParameters? = null,
replyMarkup: KeyboardMarkup? = null
): Request<ContentMessage<LivePhotoContent>> {
val livePhotoAsFile = livePhoto as? MultipartFile
val photoAsFile = photo as? MultipartFile
val data = SendLivePhotoData(
chatId = chatId,
livePhoto = livePhoto,
photo = photo,
text = entities.makeString(),
parseMode = null,
rawEntities = entities.toRawMessageEntities(),
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
threadId = threadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
return if (livePhotoAsFile == null && photoAsFile == null) {
data
} else {
CommonMultipartFileRequest(
data,
listOfNotNull(livePhotoAsFile, photoAsFile).associateBy { it.fileId }
)
}
}
private val commonResultDeserializer: DeserializationStrategy<ContentMessage<LivePhotoContent>>
= TelegramBotAPIMessageDeserializationStrategyClass()
@ConsistentCopyVisibility
@Serializable
data class SendLivePhotoData internal constructor(
@SerialName(chatIdField)
override val chatId: ChatIdentifier,
@SerialName(livePhotoField)
val livePhoto: InputFile,
@SerialName(photoField)
val photo: InputFile,
@SerialName(captionField)
override val text: String? = null,
@SerialName(parseModeField)
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,
@OptIn(ExperimentalSerializationApi::class)
@SerialName(messageThreadIdField)
@EncodeDefault
override val threadId: MessageThreadId? = chatId.threadId,
@OptIn(ExperimentalSerializationApi::class)
@EncodeDefault
@SerialName(directMessagesTopicIdField)
override val directMessageThreadId: DirectMessageThreadId? = chatId.directMessageThreadId,
@SerialName(businessConnectionIdField)
override val businessConnectionId: BusinessConnectionId? = chatId.businessConnectionId,
@SerialName(disableNotificationField)
override val disableNotification: Boolean = false,
@SerialName(protectContentField)
override val protectContent: Boolean = false,
@SerialName(allowPaidBroadcastField)
override val allowPaidBroadcast: Boolean = false,
@SerialName(messageEffectIdField)
override val effectId: EffectId? = null,
@SerialName(suggestedPostParametersField)
override val suggestedPostParameters: SuggestedPostParameters? = null,
@SerialName(replyParametersField)
override val replyParameters: ReplyParameters? = null,
@SerialName(replyMarkupField)
override val replyMarkup: KeyboardMarkup? = null
) : DataRequest<ContentMessage<LivePhotoContent>>,
SendContentMessageRequest<ContentMessage<LivePhotoContent>>,
ReplyingMarkupSendMessageRequest<ContentMessage<LivePhotoContent>>,
TextableSendMessageRequest<ContentMessage<LivePhotoContent>>,
WithCustomizableCaptionRequest<ContentMessage<LivePhotoContent>>,
OptionallyWithSpoilerRequest
{
override val textSources: TextSourcesList? by lazy {
rawEntities ?.asTextSources(text ?: return@lazy null)
}
init {
text ?.let {
if (it.length !in captionLength) {
throwRangeError("Caption length", captionLength, it.length)
}
}
}
override fun method(): String = "sendLivePhoto"
override val resultDeserializer: DeserializationStrategy<ContentMessage<LivePhotoContent>>
get() = commonResultDeserializer
override val requestSerializer: SerializationStrategy<*>
get() = serializer()
}
@Suppress("unused")
@ConsistentCopyVisibility
data class SendLivePhotoFiles internal constructor(
val livePhoto: MultipartFile? = null,
val photo: MultipartFile? = null
) : Files by mapOfNotNull(
livePhotoField to livePhoto,
photoField to photo
)

View File

@@ -697,6 +697,7 @@ const val documentField = "document"
const val photoField = "photo"
const val audioField = "audio"
const val videoField = "video"
const val livePhotoField = "live_photo"
const val animationField = "animation"
const val venueField = "venue"
const val voiceField = "voice"

View File

@@ -120,6 +120,7 @@ sealed interface ReplyInfo {
private val photo: PhotoFile? = null,
private val sticker: Sticker? = null,
private val video: VideoFile? = null,
private val live_photo: LivePhotoFile? = null,
private val voice: VoiceFile? = null,
private val video_note: VideoNoteFile? = null,
private val contact: Contact? = null,
@@ -146,6 +147,7 @@ sealed interface ReplyInfo {
story != null -> story
audio != null -> audio
video != null -> video
live_photo != null -> live_photo
video_note != null -> video_note
animation != null -> animation
document != null -> document

View File

@@ -0,0 +1,74 @@
package dev.inmo.tgbotapi.types.files
import dev.inmo.tgbotapi.requests.abstracts.FileId
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.media.PollMedia
import dev.inmo.tgbotapi.types.media.TelegramMediaLivePhoto
import dev.inmo.tgbotapi.types.media.TelegramPaidMediaLivePhoto
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.utils.MimeType
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
data class LivePhotoFile(
@Suppress("SERIALIZER_TYPE_INCOMPATIBLE")
@SerialName(fileIdField)
override val fileId: FileId,
@SerialName(fileUniqueIdField)
override val fileUniqueId: TgFileUniqueId,
@SerialName(widthField)
override val width: Int,
@SerialName(heightField)
override val height: Int,
@SerialName(durationField)
override val duration: Long,
@Serializable(PhotoSerializer::class)
@SerialName(photoField)
val photo: PhotoFile? = null,
@SerialName(mimeTypeField)
override val mimeType: MimeType? = null,
@SerialName(fileSizeField)
override val fileSize: FileSize? = null
) : TelegramMediaFile,
PollMedia,
MimedMediaFile,
PlayableMediaFile,
SizedMediaFile,
MediaContentVariant,
UsefulAsPaidMediaFile
@Suppress("NOTHING_TO_INLINE")
inline fun LivePhotoFile.toTelegramMediaLivePhoto(
text: String? = null,
parseMode: ParseMode? = null,
spoilered: Boolean = false,
showCaptionAboveMedia: Boolean = false
) = TelegramMediaLivePhoto(
file = fileId,
photo = photo ?.fileId ?: fileId,
text = text,
parseMode = parseMode,
spoilered = spoilered,
showCaptionAboveMedia = showCaptionAboveMedia
)
@Suppress("NOTHING_TO_INLINE")
inline fun LivePhotoFile.toTelegramMediaLivePhoto(
textSources: TextSourcesList,
spoilered: Boolean = false,
showCaptionAboveMedia: Boolean = false
) = TelegramMediaLivePhoto(
file = fileId,
photo = photo ?.fileId ?: fileId,
entities = textSources,
spoilered = spoilered,
showCaptionAboveMedia = showCaptionAboveMedia
)
@Suppress("NOTHING_TO_INLINE")
inline fun LivePhotoFile.toTelegramPaidMediaLivePhoto() = TelegramPaidMediaLivePhoto(
file = fileId,
photo = photo ?.fileId ?: fileId
)

View File

@@ -29,7 +29,7 @@ object InputPollMediaSerializer : KSerializer<InputPollMedia> {
is TelegramMediaAnimation -> TelegramMediaAnimation.serializer().serialize(encoder, value)
is TelegramMediaAudio -> TelegramMediaAudio.serializer().serialize(encoder, value)
is TelegramMediaDocument -> TelegramMediaDocument.serializer().serialize(encoder, value)
// TODO::ADD TelegramMediaLivePhoto
is TelegramMediaLivePhoto -> TelegramMediaLivePhoto.serializer().serialize(encoder, value)
is TelegramMediaLocation -> TelegramMediaLocation.serializer().serialize(encoder, value)
is TelegramMediaPhoto -> TelegramMediaPhoto.serializer().serialize(encoder, value)
is TelegramMediaVenue -> TelegramMediaVenue.serializer().serialize(encoder, value)

View File

@@ -27,7 +27,7 @@ object InputPollOptionMediaSerializer : KSerializer<InputPollOptionMedia> {
override fun serialize(encoder: Encoder, value: InputPollOptionMedia) {
when (value) {
is TelegramMediaAnimation -> TelegramMediaAnimation.serializer().serialize(encoder, value)
// TODO::Add TelegramMediaLivePhoto
is TelegramMediaLivePhoto -> TelegramMediaLivePhoto.serializer().serialize(encoder, value)
is TelegramMediaLocation -> TelegramMediaLocation.serializer().serialize(encoder, value)
is TelegramMediaPhoto -> TelegramMediaPhoto.serializer().serialize(encoder, value)
is TelegramMediaSticker -> TelegramMediaSticker.serializer().serialize(encoder, value)

View File

@@ -19,6 +19,7 @@ object MediaGroupMemberTelegramMediaSerializer : KSerializer<MediaGroupMemberTel
when (value) {
is TelegramMediaPhoto -> TelegramMediaPhoto.serializer().serialize(encoder, value)
is TelegramMediaVideo -> TelegramMediaVideo.serializer().serialize(encoder, value)
is TelegramMediaLivePhoto -> TelegramMediaLivePhoto.serializer().serialize(encoder, value)
is TelegramMediaAudio -> TelegramMediaAudio.serializer().serialize(encoder, value)
is TelegramMediaDocument -> TelegramMediaDocument.serializer().serialize(encoder, value)
}
@@ -30,6 +31,7 @@ object MediaGroupMemberTelegramMediaSerializer : KSerializer<MediaGroupMemberTel
return when (json[typeField] ?.jsonPrimitive ?.contentOrNull) {
TelegramMediaPhoto.TYPE -> nonstrictJsonFormat.decodeFromJsonElement(TelegramMediaPhoto.serializer(), json)
TelegramMediaVideo.TYPE -> nonstrictJsonFormat.decodeFromJsonElement(TelegramMediaVideo.serializer(), json)
TelegramMediaLivePhoto.TYPE -> nonstrictJsonFormat.decodeFromJsonElement(TelegramMediaLivePhoto.serializer(), json)
TelegramMediaAudio.TYPE -> nonstrictJsonFormat.decodeFromJsonElement(TelegramMediaAudio.serializer(), json)
TelegramMediaDocument.TYPE -> nonstrictJsonFormat.decodeFromJsonElement(TelegramMediaDocument.serializer(), json)
else -> error("Illegal type of incoming MediaGroupMemberTelegramMedia")

View File

@@ -6,9 +6,11 @@ import dev.inmo.tgbotapi.types.documentField
import dev.inmo.tgbotapi.types.files.AnimationFile
import dev.inmo.tgbotapi.types.files.AudioFile
import dev.inmo.tgbotapi.types.files.DocumentFile
import dev.inmo.tgbotapi.types.files.LivePhotoFile
import dev.inmo.tgbotapi.types.files.PhotoFile
import dev.inmo.tgbotapi.types.files.Sticker
import dev.inmo.tgbotapi.types.files.VideoFile
import dev.inmo.tgbotapi.types.livePhotoField
import dev.inmo.tgbotapi.types.location.StaticLocation
import dev.inmo.tgbotapi.types.locationField
import dev.inmo.tgbotapi.types.photoField
@@ -34,6 +36,8 @@ interface PollMedia : BaseTelegramMediaFile {
val audio: AudioFile? = null,
@SerialName(documentField)
val document: DocumentFile? = null,
@SerialName(livePhotoField)
val livePhoto: LivePhotoFile? = null,
@SerialName(photoField)
val photo: PhotoFile? = null,
@SerialName(stickerField)
@@ -57,6 +61,7 @@ interface PollMedia : BaseTelegramMediaFile {
surrogate.animation != null -> surrogate.animation
surrogate.audio != null -> surrogate.audio
surrogate.document != null -> surrogate.document
surrogate.livePhoto != null -> surrogate.livePhoto
surrogate.photo != null -> surrogate.photo
surrogate.sticker != null -> surrogate.sticker
surrogate.video != null -> surrogate.video
@@ -71,6 +76,7 @@ interface PollMedia : BaseTelegramMediaFile {
animation = value as? AnimationFile,
audio = value as? AudioFile,
document = value as? DocumentFile,
livePhoto = value as? LivePhotoFile,
photo = value as? PhotoFile,
sticker = value as? Sticker,
video = value as? VideoFile,

View File

@@ -0,0 +1,83 @@
package dev.inmo.tgbotapi.types.media
import dev.inmo.tgbotapi.requests.abstracts.InputFile
import dev.inmo.tgbotapi.requests.abstracts.fileIdToSend
import dev.inmo.tgbotapi.types.*
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.message.*
import dev.inmo.tgbotapi.types.message.RawMessageEntity
import dev.inmo.tgbotapi.types.message.toRawMessageEntities
import dev.inmo.tgbotapi.utils.extensions.makeString
import kotlinx.serialization.*
fun TelegramMediaLivePhoto(
file: InputFile,
photo: InputFile,
text: String? = null,
parseMode: ParseMode? = null,
spoilered: Boolean = false,
showCaptionAboveMedia: Boolean = false
) = TelegramMediaLivePhoto(
file = file,
photo = photo,
text = text,
parseMode = parseMode,
rawEntities = null,
spoilered = spoilered,
showCaptionAboveMedia = showCaptionAboveMedia
)
fun TelegramMediaLivePhoto(
file: InputFile,
photo: InputFile,
entities: TextSourcesList,
spoilered: Boolean = false,
showCaptionAboveMedia: Boolean = false
) = TelegramMediaLivePhoto(
file = file,
photo = photo,
text = entities.makeString(),
parseMode = null,
rawEntities = entities.toRawMessageEntities(),
spoilered = spoilered,
showCaptionAboveMedia = showCaptionAboveMedia
)
@ConsistentCopyVisibility
@Serializable
data class TelegramMediaLivePhoto internal constructor(
override val file: InputFile,
@SerialName(photoField)
val photo: InputFile,
@SerialName(captionField)
override val text: String? = null,
@SerialName(parseModeField)
override val parseMode: ParseMode? = null,
@SerialName(captionEntitiesField)
private val rawEntities: List<RawMessageEntity>? = null,
@SerialName(hasSpoilerField)
override val spoilered: Boolean = false,
@SerialName(showCaptionAboveMediaField)
override val showCaptionAboveMedia: Boolean = false,
) : TelegramFreeMedia,
VisualMediaGroupMemberTelegramMedia,
InputPollMedia,
InputPollOptionMedia {
@EncodeDefault
override val type: String = TYPE
override val textSources: TextSourcesList? by lazy {
rawEntities ?.asTextSources(text ?: return@lazy null)
}
override fun serialize(format: StringFormat): String = format.encodeToString(serializer(), this)
@SerialName(mediaField)
override val media: String
init { media = file.fileIdToSend } // crutch until js compiling will be fixed
companion object {
const val TYPE = "live_photo"
}
}

View File

@@ -18,10 +18,12 @@ object TelegramMediaSerializer : KSerializer<TelegramMedia> {
is TelegramMediaVideo -> TelegramMediaVideo.serializer().serialize(encoder, value)
is TelegramMediaAudio -> TelegramMediaAudio.serializer().serialize(encoder, value)
is TelegramMediaPhoto -> TelegramMediaPhoto.serializer().serialize(encoder, value)
is TelegramMediaLivePhoto -> TelegramMediaLivePhoto.serializer().serialize(encoder, value)
is TelegramMediaAnimation -> TelegramMediaAnimation.serializer().serialize(encoder, value)
is TelegramMediaDocument -> TelegramMediaDocument.serializer().serialize(encoder, value)
is TelegramPaidMediaVideo -> TelegramPaidMediaVideo.serializer().serialize(encoder, value)
is TelegramPaidMediaPhoto -> TelegramPaidMediaPhoto.serializer().serialize(encoder, value)
is TelegramPaidMediaLivePhoto -> TelegramPaidMediaLivePhoto.serializer().serialize(encoder, value)
is TelegramMediaSticker -> TelegramMediaSticker.serializer().serialize(encoder, value)
}
}

View File

@@ -0,0 +1,28 @@
package dev.inmo.tgbotapi.types.media
import dev.inmo.tgbotapi.requests.abstracts.InputFile
import dev.inmo.tgbotapi.requests.abstracts.fileIdToSend
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.files.LivePhotoFile
import dev.inmo.tgbotapi.types.files.toTelegramPaidMediaLivePhoto
import dev.inmo.tgbotapi.types.message.payments.PaidMedia
import kotlinx.serialization.*
@Serializable
data class TelegramPaidMediaLivePhoto(
override val file: InputFile,
@SerialName(photoField)
val photo: InputFile,
) : VisualTelegramPaidMedia {
override val type: String = TYPE
@SerialName(mediaField)
override val media: String
init { media = file.fileIdToSend } // crutch until js compiling will be fixed
companion object {
const val TYPE = "live_photo"
}
}
fun PaidMedia.LivePhoto.toTelegramPaidMediaLivePhoto(): TelegramPaidMediaLivePhoto = livePhoto.toTelegramPaidMediaLivePhoto()

View File

@@ -102,6 +102,7 @@ internal data class RawMessage(
private val photo: PhotoFile? = null,
private val sticker: Sticker? = null,
private val video: VideoFile? = null,
private val live_photo: LivePhotoFile? = null,
private val voice: VoiceFile? = null,
private val video_note: VideoNoteFile? = null,
private val contact: Contact? = null,
@@ -243,6 +244,14 @@ internal data class RawMessage(
quote,
show_caption_above_media
)
live_photo != null -> LivePhotoContent(
live_photo,
caption,
adaptedCaptionEntities,
has_media_spoiler ?: false,
quote,
show_caption_above_media
)
animation != null -> AnimationContent(
animation,
document,

View File

@@ -43,6 +43,7 @@ sealed interface MessageContent: ResendableContent {
subclass(PhotoContent::class)
subclass(VideoContent::class)
subclass(LivePhotoContent::class)
subclass(AudioContent::class)
subclass(DocumentContent::class)
@@ -65,6 +66,7 @@ sealed interface MessageContent: ResendableContent {
subclass(AudioContent::class)
subclass(DocumentContent::class)
subclass(VideoContent::class)
subclass(LivePhotoContent::class)
subclass(PhotoContent::class)
subclass(AnimationContent::class)
}
@@ -77,6 +79,7 @@ sealed interface MessageContent: ResendableContent {
polymorphic(MediaContent::class) {
subclass(VideoNoteContent::class)
subclass(VideoContent::class)
subclass(LivePhotoContent::class)
subclass(StickerContent::class)
subclass(PhotoContent::class)
subclass(VoiceContent::class)
@@ -88,6 +91,7 @@ sealed interface MessageContent: ResendableContent {
}
polymorphic(SpoilerableMediaContent::class) {
subclass(VideoContent::class)
subclass(LivePhotoContent::class)
subclass(PhotoContent::class)
subclass(AnimationContent::class)
@@ -122,6 +126,7 @@ sealed interface MessageContent: ResendableContent {
polymorphic(VisualMediaGroupPartContent::class) {
subclass(PhotoContent::class)
subclass(VideoContent::class)
subclass(LivePhotoContent::class)
visualMediaGroupContentAdditionalBuilder()
}

View File

@@ -0,0 +1,63 @@
package dev.inmo.tgbotapi.types.message.content
import dev.inmo.tgbotapi.requests.abstracts.Request
import dev.inmo.tgbotapi.requests.send.media.SendLivePhoto
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
import dev.inmo.tgbotapi.types.media.TelegramMediaLivePhoto
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.files.LivePhotoFile
import dev.inmo.tgbotapi.types.files.toTelegramMediaLivePhoto
import dev.inmo.tgbotapi.types.message.SuggestedPostParameters
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import kotlinx.serialization.Serializable
@Serializable
data class LivePhotoContent(
override val media: LivePhotoFile,
override val text: String? = null,
override val textSources: TextSourcesList = emptyList(),
override val spoilered: Boolean = false,
override val quote: TextQuote? = null,
override val showCaptionAboveMedia: Boolean = false
) : VisualMediaGroupPartContent {
override fun createResend(
chatId: ChatIdentifier,
messageThreadId: MessageThreadId?,
directMessageThreadId: DirectMessageThreadId?,
businessConnectionId: BusinessConnectionId?,
disableNotification: Boolean,
protectContent: Boolean,
allowPaidBroadcast: Boolean,
effectId: EffectId?,
suggestedPostParameters: SuggestedPostParameters?,
replyParameters: ReplyParameters?,
replyMarkup: KeyboardMarkup?
): Request<ContentMessage<LivePhotoContent>> = SendLivePhoto(
chatId = chatId,
livePhoto = media.fileId,
photo = media.photo ?.fileId ?: media.fileId,
entities = textSources,
showCaptionAboveMedia = showCaptionAboveMedia,
spoilered = spoilered,
threadId = messageThreadId,
directMessageThreadId = directMessageThreadId,
businessConnectionId = businessConnectionId,
disableNotification = disableNotification,
protectContent = protectContent,
allowPaidBroadcast = allowPaidBroadcast,
effectId = effectId,
suggestedPostParameters = suggestedPostParameters,
replyParameters = replyParameters,
replyMarkup = replyMarkup
)
override fun toMediaGroupMemberTelegramMedia(): TelegramMediaLivePhoto = asTelegramMedia()
override fun asTelegramMedia(): TelegramMediaLivePhoto = media.toTelegramMediaLivePhoto(
textSources = textSources,
spoilered = spoilered,
showCaptionAboveMedia = showCaptionAboveMedia
)
}

View File

@@ -45,6 +45,7 @@ data class PaidMediaInfoContent(
is PaidMedia.Preview -> null
is PaidMedia.Unknown -> null
is PaidMedia.Video -> it.video.toTelegramPaidMediaVideo()
is PaidMedia.LivePhoto -> it.livePhoto.toTelegramPaidMediaLivePhoto()
}
}.ifEmpty {
error("Unable to create resend for paid media content without any revealed content")

View File

@@ -30,6 +30,7 @@ typealias DocumentMediaGroupMessage = CommonMessage<DocumentMediaGroupPartConten
typealias DocumentMessage = CommonMessage<DocumentContent>
typealias VisualMediaGroupMessage = CommonMessage<VisualMediaGroupPartContent>
typealias VideoMessage = CommonMessage<VideoContent>
typealias LivePhotoMessage = CommonMessage<LivePhotoContent>
typealias PhotoMessage = CommonMessage<PhotoContent>
typealias AnimationMessage = CommonMessage<AnimationContent>
typealias ScheduledGiveawayContentMessage = CommonMessage<GiveawayContent>

View File

@@ -4,6 +4,7 @@
package dev.inmo.tgbotapi.types.message.payments
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.files.LivePhotoFile
import dev.inmo.tgbotapi.types.files.PhotoFile
import dev.inmo.tgbotapi.types.files.TelegramMediaFile
import dev.inmo.tgbotapi.types.files.VideoFile
@@ -68,6 +69,20 @@ sealed interface PaidMedia {
}
}
@Serializable
data class LivePhoto(
@SerialName(livePhotoField)
val livePhoto: LivePhotoFile
) : PaidMedia {
@EncodeDefault
@SerialName(typeField)
override val type: String = Companion.type
companion object {
val type: String = "live_photo"
}
}
@Serializable(Companion::class)
data class Unknown(
@SerialName(typeField)
@@ -89,7 +104,9 @@ sealed interface PaidMedia {
@SerialName(photoField)
val photo: PhotoFile? = null,
@SerialName(videoField)
val video: VideoFile? = null
val video: VideoFile? = null,
@SerialName(livePhotoField)
val livePhoto: LivePhotoFile? = null
)
override val descriptor: SerialDescriptor
@@ -112,6 +129,9 @@ sealed interface PaidMedia {
Video.type -> Video(
data.video ?: return unknown
)
LivePhoto.type -> LivePhoto(
data.livePhoto ?: return unknown
)
else -> unknown
}
}
@@ -127,6 +147,7 @@ sealed interface PaidMedia {
(value as? Preview) ?.duration,
(value as? Photo) ?.photo,
(value as? Video) ?.video,
(value as? LivePhoto) ?.livePhoto,
)
Surrogate.serializer().serialize(encoder, surrogate)
}

View File

@@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.types.media.*
fun PaidMedia.toTelegramPaidMediaOrNull(): TelegramPaidMedia? = when (this) {
is PaidMedia.Photo -> toTelegramMediaPhoto()
is PaidMedia.Video -> toTelegramPaidMediaVideo()
is PaidMedia.LivePhoto -> toTelegramPaidMediaLivePhoto()
is PaidMedia.Preview, is PaidMedia.Unknown -> null
}