diff --git a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/media/InputPaidMedia.kt b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/media/InputPaidMedia.kt index be45b37bd2..f3151df2e6 100644 --- a/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/media/InputPaidMedia.kt +++ b/telegram-bot/src/commonMain/kotlin/eu/vendeli/tgbot/types/media/InputPaidMedia.kt @@ -6,6 +6,7 @@ import eu.vendeli.tgbot.types.internal.InputFile import eu.vendeli.tgbot.utils.toImplicitFile import kotlinx.serialization.ExperimentalSerializationApi import kotlinx.serialization.InternalSerializationApi +import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable import kotlinx.serialization.serializer @@ -18,6 +19,7 @@ sealed class InputPaidMedia : ImplicitMediaData { } @Serializable + @SerialName("photo") data class Photo( override var media: ImplicitFile, ) : InputPaidMedia() { @@ -26,6 +28,7 @@ sealed class InputPaidMedia : ImplicitMediaData { } @Serializable + @SerialName("video") data class Video( override var media: ImplicitFile, override var thumbnail: ImplicitFile? = null, diff --git a/telegram-bot/src/jvmTest/kotlin/eu/vendeli/api/media/SendPaidMediaTest.kt b/telegram-bot/src/jvmTest/kotlin/eu/vendeli/api/media/SendPaidMediaTest.kt index 14b5d07ab3..e99387d5c0 100644 --- a/telegram-bot/src/jvmTest/kotlin/eu/vendeli/api/media/SendPaidMediaTest.kt +++ b/telegram-bot/src/jvmTest/kotlin/eu/vendeli/api/media/SendPaidMediaTest.kt @@ -25,9 +25,9 @@ class SendPaidMediaTest : BotTestContext() { request.run { paidMedia.shouldNotBeNull() - paidMedia!!.starCount shouldBe 1 - paidMedia!!.paidMedia.size shouldBe 2 - paidMedia!!.paidMedia.all { it.type == "photo" } shouldBe true + paidMedia.starCount shouldBe 1 + paidMedia.paidMedia.size shouldBe 2 + paidMedia.paidMedia.all { it.type == "photo" } shouldBe true } } }