tgbotapi/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/RawInlineQuery.kt

27 lines
747 B
Kotlin

package dev.inmo.tgbotapi.types.InlineQueries.query
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.location.StaticLocation
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
@Serializable
internal data class RawInlineQuery(
@SerialName(idField)
val id: InlineQueryIdentifier,
@SerialName(fromField)
val from: User,
@SerialName(queryField)
val query: String,
@SerialName(offsetField)
val offset: String,
@SerialName(locationField)
val location: StaticLocation? = null
) {
val asInlineQuery by lazy {
location ?.let {
LocationInlineQuery(id, from, query, offset, location)
} ?: BaseInlineQuery(id, from, query, offset)
}
}