mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-23 00:57:13 +00:00
add InlineQuery#createAnswer
This commit is contained in:
parent
05b447da85
commit
0138036ed2
@ -3,6 +3,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests.answers
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult
|
||||
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.abstracts.InlineQuery
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.internal.BooleanSerializer
|
||||
|
||||
@ -30,3 +31,20 @@ data class AnswerInlineQuery(
|
||||
override fun method(): String = "answerInlineQuery"
|
||||
override fun resultSerializer(): KSerializer<Boolean> = BooleanSerializer
|
||||
}
|
||||
|
||||
fun InlineQuery.createAnswer(
|
||||
results: List<InlineQueryResult> = emptyList(),
|
||||
cachedTime: Int? = null,
|
||||
isPersonal: Boolean? = null,
|
||||
nextOffset: String? = null,
|
||||
switchPmText: String? = null,
|
||||
switchPmParameter: String? = null
|
||||
) = AnswerInlineQuery(
|
||||
id,
|
||||
results,
|
||||
cachedTime,
|
||||
isPersonal,
|
||||
nextOffset,
|
||||
switchPmText,
|
||||
switchPmParameter
|
||||
)
|
||||
|
@ -8,6 +8,4 @@ interface InlineQuery {
|
||||
val from: User
|
||||
val query: String
|
||||
val offset: Long
|
||||
|
||||
fun answerQuery()
|
||||
}
|
@ -9,8 +9,4 @@ data class BaseInlineQuery(
|
||||
override val from: User,
|
||||
override val query: String,
|
||||
override val offset: Long
|
||||
) : InlineQuery {
|
||||
override fun answerQuery() {
|
||||
TODO()
|
||||
}
|
||||
}
|
||||
) : InlineQuery
|
||||
|
@ -9,8 +9,4 @@ data class LocationInlineQuery(
|
||||
override val query: String,
|
||||
override val offset: Long,
|
||||
val location: Location
|
||||
) : InlineQuery {
|
||||
override fun answerQuery() {
|
||||
TODO()
|
||||
}
|
||||
}
|
||||
) : InlineQuery
|
||||
|
Loading…
Reference in New Issue
Block a user