From 7471da4ff0f287ddb7cc61250ef62fb46ea53e8c Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sun, 30 Oct 2022 19:47:23 +0600 Subject: [PATCH] update version of library --- .../inmo/tgbotapi/bot/ktor/base/MultipartRequestCallFactory.kt | 2 +- .../dev/inmo/tgbotapi/requests/chat/modify/SetChatPhoto.kt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/base/MultipartRequestCallFactory.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/base/MultipartRequestCallFactory.kt index f52a9e87b3..0fdcd1c5af 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/base/MultipartRequestCallFactory.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/bot/ktor/base/MultipartRequestCallFactory.kt @@ -17,7 +17,7 @@ class MultipartRequestCallFactory : AbstractRequestCallFactory() { ): Any? = (request as? MultipartRequest) ?.let { castedRequest -> MultiPartFormDataContent( formData { - val params = castedRequest.paramsJson.mapWithCommonValues() + val params = castedRequest.paramsJson.mapWithCommonValues() - castedRequest.mediaMap.keys for ((key, value) in castedRequest.mediaMap + params) { when (value) { is MultipartFile -> appendInput( diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/SetChatPhoto.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/SetChatPhoto.kt index be2dbcfc6d..aaf3817a4b 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/SetChatPhoto.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/requests/chat/modify/SetChatPhoto.kt @@ -13,6 +13,7 @@ import kotlinx.serialization.json.JsonObject data class SetChatPhoto ( @SerialName(chatIdField) override val chatId: ChatIdentifier, + @Transient val photo: MultipartFile = throw IllegalArgumentException("Unfortunately, this type of objects can't be parsed automatically") ): ChatRequest, MultipartRequest { override fun method(): String = "setChatPhoto"