From 051922b4c2752cb3463344c17e1ac87a23c01340 Mon Sep 17 00:00:00 2001 From: bpavuk Date: Mon, 8 Jul 2024 22:46:26 +0300 Subject: [PATCH 1/4] Bot API 7.6 added invoice payload field to TransactionPartner.User --- .../types/payments/stars/TransactionPartner.kt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/stars/TransactionPartner.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/stars/TransactionPartner.kt index 2986c53927..fe53028254 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/stars/TransactionPartner.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/stars/TransactionPartner.kt @@ -1,6 +1,8 @@ package dev.inmo.tgbotapi.types.payments.stars +import dev.inmo.tgbotapi.types.InvoicePayload import dev.inmo.tgbotapi.types.chat.PreviewUser +import dev.inmo.tgbotapi.types.invoicePayloadField import dev.inmo.tgbotapi.types.userField import dev.inmo.tgbotapi.types.withdrawalStateField import dev.inmo.tgbotapi.utils.decodeDataAndJson @@ -35,7 +37,9 @@ sealed interface TransactionPartner { @Serializable(TransactionPartner.Companion::class) data class User( @SerialName(userField) - val user: PreviewUser + val user: PreviewUser, + @SerialName(invoicePayloadField) + val invoicePayload: InvoicePayload? = null ) : TransactionPartner { override val type: String get() = Companion.type @@ -61,7 +65,9 @@ sealed interface TransactionPartner { private data class Surrogate( val type: String, val withdrawal_state: RevenueWithdrawalState? = null, - val user: PreviewUser? = null + val user: PreviewUser? = null, + @SerialName(invoicePayloadField) + val invoicePayload: InvoicePayload? = null ) override val descriptor: SerialDescriptor From bfff55ab084d57da9146880d7e1765500c6ff3f0 Mon Sep 17 00:00:00 2001 From: bpavuk Date: Mon, 8 Jul 2024 22:49:35 +0300 Subject: [PATCH 2/4] Bot API 7.6 added section_separator_color field to theme params in Bot Webapps --- .../src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/ThemeParams.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/ThemeParams.kt b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/ThemeParams.kt index e9d19c273a..754e6e881a 100644 --- a/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/ThemeParams.kt +++ b/tgbotapi.webapps/src/jsMain/kotlin/dev/inmo/tgbotapi/webapps/ThemeParams.kt @@ -43,4 +43,6 @@ external interface ThemeParams { val subtitleTextColor: Color.Hex? @JsName("destructive_text_color") val destructiveTextColor: Color.Hex? + @JsName("section_separator_color") + val sectionSeparatorColor: Color.Hex? } From 83352dd284b124dcf7f95b7ebf7d8c5970b0f556 Mon Sep 17 00:00:00 2001 From: bpavuk Date: Tue, 9 Jul 2024 13:32:00 +0300 Subject: [PATCH 3/4] Bot API 7.6 removed @SerialName annotations from TransactionPartner.User data class fields --- .../inmo/tgbotapi/types/payments/stars/TransactionPartner.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/stars/TransactionPartner.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/stars/TransactionPartner.kt index 86b8ac9948..0aa2b9dd5d 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/stars/TransactionPartner.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/stars/TransactionPartner.kt @@ -38,10 +38,8 @@ sealed interface TransactionPartner { @Serializable(TransactionPartner.Companion::class) data class User( - @SerialName(userField) val user: PreviewUser, - @SerialName(invoicePayloadField) - val invoicePayload: InvoicePayload? = null + val invoice_payload: InvoicePayload? = null ) : TransactionPartner { override val type: String get() = Companion.type From 3383bcaff3fe11c41a9d62a05da3e9da784d3fef Mon Sep 17 00:00:00 2001 From: bpavuk Date: Tue, 9 Jul 2024 13:52:53 +0300 Subject: [PATCH 4/4] Bot API 7.6 i am sleepyhead (: --- .../tgbotapi/types/payments/stars/TransactionPartner.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/stars/TransactionPartner.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/stars/TransactionPartner.kt index 0aa2b9dd5d..11c1e20722 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/stars/TransactionPartner.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/payments/stars/TransactionPartner.kt @@ -38,8 +38,10 @@ sealed interface TransactionPartner { @Serializable(TransactionPartner.Companion::class) data class User( + @SerialName(userField) val user: PreviewUser, - val invoice_payload: InvoicePayload? = null + @SerialName(invoicePayloadField) + val invoicePayload: InvoicePayload? = null ) : TransactionPartner { override val type: String get() = Companion.type @@ -73,8 +75,7 @@ sealed interface TransactionPartner { val type: String, val withdrawal_state: RevenueWithdrawalState? = null, val user: PreviewUser? = null, - @SerialName(invoicePayloadField) - val invoicePayload: InvoicePayload? = null + val invoice_payload: InvoicePayload? = null ) override val descriptor: SerialDescriptor