1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-01 23:45:25 +00:00
tgbotapi/src/main/kotlin/com/github/insanusmokrassar/TelegramBotAPI/types/InlineQueries/query/RawInlineQuery.kt

27 lines
703 B
Kotlin
Raw Normal View History

2018-12-26 08:07:24 +00:00
package com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.query
import com.github.insanusmokrassar.TelegramBotAPI.types.*
import kotlinx.serialization.*
@Serializable
data class RawInlineQuery(
@SerialName(idField)
val id: InlineQueryIdentifier,
@SerialName(fromField)
val from: User,
@SerialName(queryField)
val query: String,
@SerialName(offsetField)
val offset: Long,
@SerialName(locationField)
@Optional
val location: Location? = null
) {
@Transient
val asInlineQuery by lazy {
location ?.let {
LocationInlineQuery(id, from, query, offset, location)
} ?: BaseInlineQuery(id, from, query, offset)
}
}