mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-25 19:48:43 +00:00
try to fix problem with arguments in InputMedia
This commit is contained in:
parent
1019fd4d19
commit
c3978f2dab
@ -27,8 +27,7 @@ data class InputMediaPhoto(
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
@Deprecated("Marked as deprecated for removal in future updates", level = DeprecationLevel.ERROR)
|
override val arguments: Map<String, Any?> = buildArguments(serializer())
|
||||||
override val arguments: Map<String, Any?> = error("Unsupported operation")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fun PhotoSize.toInputMediaPhoto(
|
fun PhotoSize.toInputMediaPhoto(
|
||||||
|
@ -31,6 +31,5 @@ data class InputMediaVideo(
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Transient
|
@Transient
|
||||||
@Deprecated("Marked as deprecated for removal in future updates", level = DeprecationLevel.ERROR)
|
override val arguments: Map<String, Any?> = buildArguments(serializer())
|
||||||
override val arguments: Map<String, Any?> = error("Unsupported operation")
|
|
||||||
}
|
}
|
||||||
|
@ -1,12 +1,16 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia
|
package com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia
|
||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CaptionedOutput
|
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CaptionedOutput
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.*
|
||||||
import kotlinx.serialization.StringFormat
|
import kotlinx.serialization.properties.Properties
|
||||||
|
|
||||||
|
internal fun <T> T.buildArguments(withSerializer: SerializationStrategy<T>) = Properties.encodeToMap(
|
||||||
|
withSerializer,
|
||||||
|
this
|
||||||
|
)
|
||||||
|
|
||||||
@Serializable(MediaGroupMemberInputMediaSerializer::class)
|
@Serializable(MediaGroupMemberInputMediaSerializer::class)
|
||||||
interface MediaGroupMemberInputMedia : InputMedia, CaptionedOutput {
|
interface MediaGroupMemberInputMedia : InputMedia, CaptionedOutput {
|
||||||
fun serialize(format: StringFormat): String
|
fun serialize(format: StringFormat): String
|
||||||
@Deprecated("Marked as deprecated for removal in future updates", level = DeprecationLevel.ERROR)
|
|
||||||
val arguments: Map<String, Any?>
|
val arguments: Map<String, Any?>
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user