From 12184cd2be8f5aabea1e4ac3d03aa05986b880f2 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Sat, 29 May 2021 13:40:48 +0600 Subject: [PATCH] InlineKeyboardButton now is an interface --- .../InlineKeyboardButton.kt | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton.kt index 4940bba946..19f79faf4d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/InlineKeyboardButtons/InlineKeyboardButton.kt @@ -7,22 +7,22 @@ import kotlinx.serialization.Serializable import kotlinx.serialization.json.JsonElement @Serializable(InlineKeyboardButtonSerializer::class) -sealed class InlineKeyboardButton { - abstract val text: String +sealed interface InlineKeyboardButton { + val text: String } @Serializable data class UnknownInlineKeyboardButton internal constructor( override val text: String, val rawData: JsonElement -) : InlineKeyboardButton() +) : InlineKeyboardButton @Serializable data class PayInlineKeyboardButton( override val text: String, @SerialName(payField) val pay: Boolean -) : InlineKeyboardButton() +) : InlineKeyboardButton @Serializable data class CallbackDataInlineKeyboardButton( @@ -30,13 +30,13 @@ data class CallbackDataInlineKeyboardButton( override val text: String, @SerialName(callbackDataField) val callbackData: String -) : InlineKeyboardButton() +) : InlineKeyboardButton @Serializable data class CallbackGameInlineKeyboardButton( @SerialName(textField) override val text: String -) : InlineKeyboardButton() { +) : InlineKeyboardButton { @SerialName(callbackGameField) private val callbackGame = CallbackGame } @@ -46,25 +46,25 @@ data class LoginURLInlineKeyboardButton( override val text: String, @SerialName(loginUrlField) val loginUrl: LoginURL -) : InlineKeyboardButton() +) : InlineKeyboardButton @Serializable data class SwitchInlineQueryCurrentChatInlineKeyboardButton( override val text: String, @SerialName(switchInlineQueryCurrentChatField) val switchInlineQueryCurrentChat: String -) : InlineKeyboardButton() +) : InlineKeyboardButton @Serializable data class SwitchInlineQueryInlineKeyboardButton( override val text: String, @SerialName(switchInlineQueryField) val switchInlineQuery: String -) : InlineKeyboardButton() +) : InlineKeyboardButton @Serializable data class URLInlineKeyboardButton( override val text: String, @SerialName(urlField) val url: String -) : InlineKeyboardButton() +) : InlineKeyboardButton