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

add serializer to InlineKeyboardButton and remove exact serializer for InlineKeyboardMarkup#keyboard

This commit is contained in:
InsanusMokrassar 2019-04-20 13:09:47 +08:00
parent 6d8190e5aa
commit b002f61b71
2 changed files with 6 additions and 6 deletions

View File

@ -1,5 +1,10 @@
package com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardButtons
import kotlinx.serialization.*
@Serializable(InlineKeyboardButtonSerializer::class)
interface InlineKeyboardButton {
val text: String
}
}
object InlineKeyboardButtonSerializer : KSerializer<InlineKeyboardButton> by ContextSerializer(InlineKeyboardButton::class)

View File

@ -7,10 +7,5 @@ import kotlinx.serialization.internal.ArrayListSerializer
@Serializable
data class InlineKeyboardMarkup(
@SerialName("inline_keyboard")
@Serializable(with = KeyboardSerializer::class)
val keyboard: Matrix<InlineKeyboardButton>
) : KeyboardMarkup
object KeyboardSerializer : KSerializer<Matrix<InlineKeyboardButton>> by ArrayListSerializer(
ArrayListSerializer(ContextSerializer(InlineKeyboardButton::class))
)