1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-01 07:25:23 +00:00
tgbotapi/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/ChosenInlineResult/RawChosenInlineResult.kt

28 lines
953 B
Kotlin
Raw Normal View History

2020-10-04 11:06:30 +00:00
package dev.inmo.tgbotapi.types.InlineQueries.ChosenInlineResult
2018-12-26 08:07:24 +00:00
2020-10-04 11:06:30 +00:00
import dev.inmo.tgbotapi.types.*
2022-04-21 18:16:41 +00:00
import dev.inmo.tgbotapi.types.chat.User
2020-11-04 19:12:14 +00:00
import dev.inmo.tgbotapi.types.location.StaticLocation
2019-12-06 10:46:38 +00:00
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
2018-12-26 08:07:24 +00:00
@Serializable
2019-08-17 16:51:26 +00:00
internal data class RawChosenInlineResult(
2018-12-26 08:07:24 +00:00
@SerialName(resultIdField)
2024-03-16 15:17:36 +00:00
val resultId: InlineQueryId, //chosen temporary, can be changed
2018-12-26 08:07:24 +00:00
@SerialName(fromField)
val user: User,
@SerialName(queryField)
val query: String,
@SerialName(locationField)
2020-11-04 19:12:14 +00:00
val location: StaticLocation? = null,
2018-12-26 08:07:24 +00:00
@SerialName(inlineMessageIdField)
2024-03-16 14:36:48 +00:00
val inlineMessageId: InlineMessageId? = null
2018-12-26 08:07:24 +00:00
) {
val asChosenInlineResult: ChosenInlineResult by lazy {
2021-06-30 05:26:31 +00:00
location ?.let {
2018-12-26 08:07:24 +00:00
LocationChosenInlineResult(resultId, user, location, inlineMessageId, query)
} ?: BaseChosenInlineResult(resultId, user, inlineMessageId, query)
}
}