From 53e8c53fb171b84fdf3dacbbe475e19d1cd2cf23 Mon Sep 17 00:00:00 2001 From: InsanusMokrassar Date: Wed, 11 May 2022 12:08:20 +0600 Subject: [PATCH] extract ReplyKeyboardMarkup fields names to the constants --- .../commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt | 2 ++ .../dev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup.kt | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt index 5e4650b49c..ccebdf3348 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/Common.kt @@ -391,6 +391,8 @@ const val requireShippingAddressField = "need_shipping_address" const val shouldSendPhoneNumberToProviderField = "send_phone_number_to_provider" const val shouldSendEmailToProviderField = "send_email_to_provider" +const val resizeKeyboardField = "resize_keyboard" +const val oneTimeKeyboardField = "one_time_keyboard" const val inputFieldPlaceholderField = "input_field_placeholder" const val priceDependOnShipAddressField = "is_flexible" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup.kt index a88703b9ff..753b947389 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup.kt @@ -1,16 +1,15 @@ package dev.inmo.tgbotapi.types.buttons -import dev.inmo.tgbotapi.types.inputFieldPlaceholderField -import dev.inmo.tgbotapi.types.inputFieldPlaceholderLimit +import dev.inmo.tgbotapi.types.* import kotlinx.serialization.SerialName import kotlinx.serialization.Serializable @Serializable data class ReplyKeyboardMarkup( val keyboard: Matrix, - @SerialName("resize_keyboard") + @SerialName(resizeKeyboardField) val resizeKeyboard: Boolean? = null, - @SerialName("one_time_keyboard") + @SerialName(oneTimeKeyboardField) val oneTimeKeyboard: Boolean? = null, @SerialName(inputFieldPlaceholderField) val inputFieldPlaceholder: String? = null,