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/query/RawInlineQuery.kt

31 lines
903 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.*
2022-04-21 18:16:41 +00:00
import dev.inmo.tgbotapi.types.chat.*
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)
2024-03-16 15:17:36 +00:00
val id: InlineQueryId,
2018-12-26 08:07:24 +00:00
@SerialName(fromField)
2023-03-02 14:33:49 +00:00
val from: CommonUser,
2018-12-26 08:07:24 +00:00
@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
}
}