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.*
|
|
|
|
import dev.inmo.tgbotapi.types.InlineQueries.abstracts.ChosenInlineResult
|
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)
|
|
|
|
val resultId: InlineQueryIdentifier, //chosen temporary, can be changed
|
|
|
|
@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)
|
|
|
|
val inlineMessageId: InlineMessageIdentifier? = null
|
|
|
|
) {
|
|
|
|
val asChosenInlineResult: ChosenInlineResult by lazy {
|
|
|
|
location ?.let {
|
|
|
|
LocationChosenInlineResult(resultId, user, location, inlineMessageId, query)
|
|
|
|
} ?: BaseChosenInlineResult(resultId, user, inlineMessageId, query)
|
|
|
|
}
|
|
|
|
}
|