mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-27 02:57:13 +00:00
RequestPollKeyboardButton#requestPoll is required parameter for now
This commit is contained in:
parent
9dc3e1ecc6
commit
1a258ae912
@ -41,7 +41,7 @@ data class RequestLocationKeyboardButton(
|
||||
data class RequestPollKeyboardButton(
|
||||
override val text: String,
|
||||
@SerialName(requestPollField)
|
||||
val requestPoll: KeyboardButtonPollType = RegularKeyboardButtonPollType
|
||||
val requestPoll: KeyboardButtonPollType
|
||||
) : KeyboardButton()
|
||||
|
||||
@Serializer(KeyboardButton::class)
|
||||
|
@ -43,9 +43,13 @@ internal object KeyboardButtonPollTypeSerializer : KSerializer<KeyboardButtonPol
|
||||
* Crutch due to the fact that direct serialization of objects currently does not work perfectly
|
||||
*/
|
||||
override fun serialize(encoder: Encoder, obj: KeyboardButtonPollType) {
|
||||
UnknownKeyboardButtonPollType.serializer().serialize(
|
||||
JsonObjectSerializer.serialize(
|
||||
encoder,
|
||||
(obj as? UnknownKeyboardButtonPollType) ?: UnknownKeyboardButtonPollType(obj.type)
|
||||
JsonObject(
|
||||
mapOf(
|
||||
typeField to JsonPrimitive(obj.type)
|
||||
)
|
||||
)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user