From b27efd118ba5603b464355db169e86a269fc6369 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Tue, 9 Jul 2024 02:15:49 +0600 Subject: [PATCH] add paid media into reply info --- tgbotapi.core/api/tgbotapi.core.api | 2 +- .../src/commonMain/kotlin/dev/inmo/tgbotapi/types/ReplyInfo.kt | 2 ++ .../kotlin/dev/inmo/tgbotapi/types/files/PaidMediaInfo.kt | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index e29a61defa..651670e91b 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -16738,7 +16738,7 @@ public abstract interface class dev/inmo/tgbotapi/types/files/MediaContentVarian public abstract interface class dev/inmo/tgbotapi/types/files/MimedMediaFile : dev/inmo/tgbotapi/abstracts/MimeTyped, dev/inmo/tgbotapi/types/files/TelegramMediaFile { } -public final class dev/inmo/tgbotapi/types/files/PaidMediaInfo { +public final class dev/inmo/tgbotapi/types/files/PaidMediaInfo : dev/inmo/tgbotapi/types/ReplyInfo$External$ContentVariant { public static final field Companion Ldev/inmo/tgbotapi/types/files/PaidMediaInfo$Companion; public fun (ILjava/util/List;)V public final fun component1 ()I diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ReplyInfo.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ReplyInfo.kt index fbef4dbbd8..6d796eb1cb 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ReplyInfo.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/ReplyInfo.kt @@ -89,6 +89,7 @@ sealed interface ReplyInfo { private val story: Story? = null, private val audio: AudioFile? = null, private val document: DocumentFile? = null, + private val paid_media: PaidMediaInfo? = null, private val animation: AnimationFile? = null, private val game: RawGame? = null, @Serializable(PhotoSerializer::class) @@ -123,6 +124,7 @@ sealed interface ReplyInfo { video_note != null -> video_note animation != null -> animation document != null -> document + paid_media != null -> paid_media voice != null -> voice photo != null -> photo sticker != null -> sticker diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/PaidMediaInfo.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/PaidMediaInfo.kt index 87b7a92117..2c47a868f0 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/PaidMediaInfo.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/files/PaidMediaInfo.kt @@ -1,5 +1,6 @@ package dev.inmo.tgbotapi.types.files +import dev.inmo.tgbotapi.types.ReplyInfo import dev.inmo.tgbotapi.types.message.payments.PaidMedia import dev.inmo.tgbotapi.types.paidMediaField import dev.inmo.tgbotapi.types.starCountField @@ -12,4 +13,4 @@ data class PaidMediaInfo( val stars: Int, @SerialName(paidMediaField) val media: List -) \ No newline at end of file +) : ReplyInfo.External.ContentVariant