1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-26 03:58:44 +00:00

add WebAppData

This commit is contained in:
InsanusMokrassar 2022-04-17 18:36:40 +06:00
parent 75fb72936f
commit dd0a8b99c7
3 changed files with 21 additions and 0 deletions

View File

@ -430,3 +430,5 @@ const val bankStatementField = "bank_statement"
const val rentalAgreementField = "rental_agreement" const val rentalAgreementField = "rental_agreement"
const val passportRegistrationField = "passport_registration" const val passportRegistrationField = "passport_registration"
const val temporaryRegistrationField = "temporary_registration" const val temporaryRegistrationField = "temporary_registration"
const val buttonTextField = "button_text"

View File

@ -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

View File

@ -95,6 +95,9 @@ internal data class RawMessage(
// login property // login property
private val connected_website: String? = null, private val connected_website: String? = null,
// login property
private val web_app_data: WebAppData? = null,
// passport property // passport property
private val passport_data: PassportData? = null, private val passport_data: PassportData? = null,
private val proximity_alert_triggered: ProximityAlertTriggered? = null, private val proximity_alert_triggered: ProximityAlertTriggered? = null,
@ -203,6 +206,7 @@ internal data class RawMessage(
proximity_alert_triggered != null -> proximity_alert_triggered proximity_alert_triggered != null -> proximity_alert_triggered
successful_payment != null -> SuccessfulPaymentEvent(successful_payment) successful_payment != null -> SuccessfulPaymentEvent(successful_payment)
connected_website != null -> UserLoggedIn(connected_website) connected_website != null -> UserLoggedIn(connected_website)
web_app_data != null -> web_app_data
else -> null else -> null
} }
} }