mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-06-01 23:45:25 +00:00
27 lines
971 B
Kotlin
27 lines
971 B
Kotlin
|
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.ChosenInlineResult
|
||
|
|
||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.ChosenInlineResult
|
||
|
import kotlinx.serialization.*
|
||
|
|
||
|
@Serializable
|
||
|
data class RawChosenInlineResult(
|
||
|
@SerialName(resultIdField)
|
||
|
val resultId: InlineQueryIdentifier, //chosen temporary, can be changed
|
||
|
@SerialName(fromField)
|
||
|
val user: User,
|
||
|
@SerialName(queryField)
|
||
|
val query: String,
|
||
|
@SerialName(locationField)
|
||
|
val location: Location? = null,
|
||
|
@SerialName(inlineMessageIdField)
|
||
|
val inlineMessageId: InlineMessageIdentifier? = null
|
||
|
) {
|
||
|
@Transient
|
||
|
val asChosenInlineResult: ChosenInlineResult by lazy {
|
||
|
location ?.let {
|
||
|
LocationChosenInlineResult(resultId, user, location, inlineMessageId, query)
|
||
|
} ?: BaseChosenInlineResult(resultId, user, inlineMessageId, query)
|
||
|
}
|
||
|
}
|