diff --git a/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InputMedia/InputMediaPhoto.kt b/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InputMedia/InputMediaPhoto.kt index 5fed0893a7..392cc3be77 100644 --- a/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InputMedia/InputMediaPhoto.kt +++ b/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InputMedia/InputMediaPhoto.kt @@ -27,8 +27,7 @@ data class InputMediaPhoto( } @Transient - @Deprecated("Marked as deprecated for removal in future updates", level = DeprecationLevel.ERROR) - override val arguments: Map = error("Unsupported operation") + override val arguments: Map = buildArguments(serializer()) } fun PhotoSize.toInputMediaPhoto( diff --git a/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InputMedia/InputMediaVideo.kt b/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InputMedia/InputMediaVideo.kt index aa1626ae2a..db2f87ec4a 100644 --- a/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InputMedia/InputMediaVideo.kt +++ b/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InputMedia/InputMediaVideo.kt @@ -31,6 +31,5 @@ data class InputMediaVideo( } @Transient - @Deprecated("Marked as deprecated for removal in future updates", level = DeprecationLevel.ERROR) - override val arguments: Map = error("Unsupported operation") + override val arguments: Map = buildArguments(serializer()) } diff --git a/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InputMedia/MediaGroupMemberInputMedia.kt b/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InputMedia/MediaGroupMemberInputMedia.kt index ed211ca949..2a42073f32 100644 --- a/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InputMedia/MediaGroupMemberInputMedia.kt +++ b/TelegramBotAPI-core/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InputMedia/MediaGroupMemberInputMedia.kt @@ -1,12 +1,16 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CaptionedOutput -import kotlinx.serialization.Serializable -import kotlinx.serialization.StringFormat +import kotlinx.serialization.* +import kotlinx.serialization.properties.Properties + +internal fun T.buildArguments(withSerializer: SerializationStrategy) = Properties.encodeToMap( + withSerializer, + this +) @Serializable(MediaGroupMemberInputMediaSerializer::class) interface MediaGroupMemberInputMedia : InputMedia, CaptionedOutput { fun serialize(format: StringFormat): String - @Deprecated("Marked as deprecated for removal in future updates", level = DeprecationLevel.ERROR) val arguments: Map }