1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-22 16:23:48 +00:00

fix SendMediaGroupData convertedMedia

This commit is contained in:
InsanusMokrassar 2019-02-23 18:34:55 +08:00
parent 385426552e
commit 7cc02492b4

View File

@ -5,8 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.SendMessageRequest import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.SendMessageRequest
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.* import com.github.insanusmokrassar.TelegramBotAPI.requests.send.media.base.*
import com.github.insanusmokrassar.TelegramBotAPI.types.* import com.github.insanusmokrassar.TelegramBotAPI.types.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.MediaGroupMemberInputMedia import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.*
import com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia.ThumbedInputMedia
import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage import com.github.insanusmokrassar.TelegramBotAPI.types.message.RawMessage
import com.github.insanusmokrassar.TelegramBotAPI.utils.toJsonWithoutNulls import com.github.insanusmokrassar.TelegramBotAPI.utils.toJsonWithoutNulls
import kotlinx.serialization.* import kotlinx.serialization.*
@ -70,13 +69,11 @@ data class SendMediaGroupData internal constructor(
) : Data<List<RawMessage>>, ) : Data<List<RawMessage>>,
SendMessageRequest<List<RawMessage>> SendMessageRequest<List<RawMessage>>
{ {
// TODO:: fix this nail when kotlin serialisation will support
@ImplicitReflectionSerializer
@SerialName(mediaField) @SerialName(mediaField)
private val convertedMedia: String private val convertedMedia: String
get() = jsonArray { get() = jsonArray {
media.forEach { media.forEach {
+it.toJsonWithoutNulls() +it.toJsonWithoutNulls(MediaGroupMemberInputMediaSerializer)
} }
}.toString() }.toString()