mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-23 00:57:13 +00:00
add WebAppData
This commit is contained in:
parent
643f8e577e
commit
63bcc4bcf8
@ -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"
|
||||
|
@ -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
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user