From 046402454fb947cbd0598c22c91e2baa1558a40a Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Thu, 20 Aug 2020 16:07:01 +0600 Subject: [PATCH] Revert "try to fix problem with arguments in InputMedia" This reverts commit c3978f2dabbf8d060255c4486cf2d878df490a37. --- .../TelegramBotAPI/types/InputMedia/InputMediaPhoto.kt | 3 ++- .../TelegramBotAPI/types/InputMedia/InputMediaVideo.kt | 3 ++- .../types/InputMedia/MediaGroupMemberInputMedia.kt | 10 +++------- 3 files changed, 7 insertions(+), 9 deletions(-) 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 392cc3be77..5fed0893a7 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,7 +27,8 @@ data class InputMediaPhoto( } @Transient - override val arguments: Map = buildArguments(serializer()) + @Deprecated("Marked as deprecated for removal in future updates", level = DeprecationLevel.ERROR) + override val arguments: Map = error("Unsupported operation") } 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 db2f87ec4a..aa1626ae2a 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,5 +31,6 @@ data class InputMediaVideo( } @Transient - override val arguments: Map = buildArguments(serializer()) + @Deprecated("Marked as deprecated for removal in future updates", level = DeprecationLevel.ERROR) + override val arguments: Map = error("Unsupported operation") } 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 2a42073f32..ed211ca949 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,16 +1,12 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CaptionedOutput -import kotlinx.serialization.* -import kotlinx.serialization.properties.Properties - -internal fun T.buildArguments(withSerializer: SerializationStrategy) = Properties.encodeToMap( - withSerializer, - this -) +import kotlinx.serialization.Serializable +import kotlinx.serialization.StringFormat @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 }