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 b9a6c6edf0..05e3bd174f 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 @@ -437,3 +437,5 @@ const val bankStatementField = "bank_statement" const val rentalAgreementField = "rental_agreement" const val passportRegistrationField = "passport_registration" const val temporaryRegistrationField = "temporary_registration" + +const val buttonTextField = "button_text" diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/WebAppData.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/WebAppData.kt new file mode 100644 index 0000000000..6f1d00b4a4 --- /dev/null +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/ChatEvents/WebAppData.kt @@ -0,0 +1,15 @@ +package dev.inmo.tgbotapi.types.message.ChatEvents + +import dev.inmo.tgbotapi.types.buttonTextField +import dev.inmo.tgbotapi.types.dataField +import dev.inmo.tgbotapi.types.message.ChatEvents.abstracts.PrivateEvent +import kotlinx.serialization.SerialName +import kotlinx.serialization.Serializable + +@Serializable +class WebAppData( + @SerialName(dataField) + val data: String, + @SerialName(buttonTextField) + val buttonText: String +) : PrivateEvent diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt index f48235fec9..8b7f040437 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/RawMessage.kt @@ -95,6 +95,9 @@ internal data class RawMessage( // login property private val connected_website: String? = null, + // login property + private val web_app_data: WebAppData? = null, + // passport property private val passport_data: PassportData? = null, private val proximity_alert_triggered: ProximityAlertTriggered? = null, @@ -203,6 +206,7 @@ internal data class RawMessage( proximity_alert_triggered != null -> proximity_alert_triggered successful_payment != null -> SuccessfulPaymentEvent(successful_payment) connected_website != null -> UserLoggedIn(connected_website) + web_app_data != null -> web_app_data else -> null } }