1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-06-03 00:15:27 +00:00
tgbotapi/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/query/RawInlineQuery.kt

32 lines
967 B
Kotlin
Raw Normal View History

2020-10-04 11:06:30 +00:00
package dev.inmo.tgbotapi.types.InlineQueries.query
2018-12-26 08:07:24 +00:00
2020-10-04 11:06:30 +00:00
import dev.inmo.tgbotapi.types.*
2021-04-26 14:42:26 +00:00
import dev.inmo.tgbotapi.types.chat.ChatType
import dev.inmo.tgbotapi.types.chat.ChatTypeSerializer
2020-11-05 17:48:23 +00:00
import dev.inmo.tgbotapi.types.location.Location
2021-04-28 13:59:30 +00:00
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
2018-12-26 08:07:24 +00:00
@Serializable
2019-08-17 16:49:37 +00:00
internal data class RawInlineQuery(
2018-12-26 08:07:24 +00:00
@SerialName(idField)
val id: InlineQueryIdentifier,
@SerialName(fromField)
val from: User,
@SerialName(queryField)
val query: String,
@SerialName(offsetField)
2019-02-07 11:12:26 +00:00
val offset: String,
2021-04-26 14:42:26 +00:00
@SerialName(chatTypeField)
@Serializable(ChatTypeSerializer::class)
val chatType: ChatType? = null,
2018-12-26 08:07:24 +00:00
@SerialName(locationField)
2020-11-05 17:48:23 +00:00
val location: Location? = null
2018-12-26 08:07:24 +00:00
) {
val asInlineQuery by lazy {
location ?.let {
2021-04-26 14:42:26 +00:00
LocationInlineQuery(id, from, query, offset, chatType, location)
} ?: BaseInlineQuery(id, from, query, offset, chatType)
2018-12-26 08:07:24 +00:00
}
}