From 2ac83156f6031fe54243feed5cb589d976d59800 Mon Sep 17 00:00:00 2001 From: "bpavuk (aider)" <75901693+bpavuk@users.noreply.github.com> Date: Sun, 13 Apr 2025 14:35:37 +0300 Subject: [PATCH] feat: Add UniqueGift type with related fields and constants --- .../kotlin/dev/inmo/tgbotapi/types/Common.kt | 6 ++++ .../dev/inmo/tgbotapi/types/UniqueGift.kt | 30 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/UniqueGift.kt 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 9b85df9481..18fb2a67a7 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 @@ -671,6 +671,12 @@ const val edgeColorField = "edge_color" const val symbolColorField = "symbol_color" const val textColorField = "text_color" +const val baseNameField = "base_name" +const val numberField = "number" +const val modelField = "model" +const val symbolField = "symbol" +const val backdropField = "backdrop" + const val businessConnectionIdField = "business_connection_id" const val businessIntroField = "business_intro" const val businessLocationField = "business_location" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/UniqueGift.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/UniqueGift.kt new file mode 100644 index 0000000000..1a65ff2813 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/UniqueGift.kt @@ -0,0 +1,30 @@ +package dev.inmo.tgbotapi.types + +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +/** + * This object describes a unique gift that was upgraded from a regular gift. + * + * @param baseName Human-readable name of the regular gift from which this unique gift was upgraded + * @param name Unique name of the gift. This name can be used in `https://t.me/nft/...` links and story areas + * @param number Unique number of the upgraded gift among gifts upgraded from the same regular gift + * @param model Model of the gift + * @param symbol Symbol of the gift + * @param backdrop Backdrop of the gift + */ +@Serializable +data class UniqueGift( + @SerialName(baseNameField) + val baseName: String, + @SerialName(nameField) + val name: String, + @SerialName(numberField) + val number: Int, + @SerialName(modelField) + val model: UniqueGiftModel, + @SerialName(symbolField) + val symbol: UniqueGiftSymbol, + @SerialName(backdropField) + val backdrop: UniqueGiftBackdrop +)