mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI-examples.git
synced 2024-12-22 08:37:18 +00:00
add answerInlineQuery with WebAppInfo
This commit is contained in:
parent
eccbe71e68
commit
3e2ccf9cf1
@ -1,6 +1,7 @@
|
||||
import dev.inmo.micro_utils.coroutines.subscribeSafelyWithoutExceptions
|
||||
import dev.inmo.micro_utils.ktor.server.createKtorServer
|
||||
import dev.inmo.tgbotapi.extensions.api.answers.answer
|
||||
import dev.inmo.tgbotapi.extensions.api.answers.answerInlineQuery
|
||||
import dev.inmo.tgbotapi.extensions.api.bot.getMe
|
||||
import dev.inmo.tgbotapi.extensions.api.bot.setMyCommands
|
||||
import dev.inmo.tgbotapi.extensions.api.send.*
|
||||
@ -9,6 +10,7 @@ import dev.inmo.tgbotapi.extensions.behaviour_builder.*
|
||||
import dev.inmo.tgbotapi.extensions.behaviour_builder.triggers_handling.*
|
||||
import dev.inmo.tgbotapi.extensions.utils.formatting.makeTelegramStartattach
|
||||
import dev.inmo.tgbotapi.extensions.utils.types.buttons.*
|
||||
import dev.inmo.tgbotapi.requests.answers.InlineQueryResultsButton
|
||||
import dev.inmo.tgbotapi.types.BotCommand
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.InlineQueryResultArticle
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputTextMessageContent
|
||||
@ -102,7 +104,7 @@ suspend fun main(vararg args: String) {
|
||||
onCommand("attachment_menu") {
|
||||
reply(
|
||||
it,
|
||||
,
|
||||
"Button",
|
||||
replyMarkup = inlineKeyboard {
|
||||
row {
|
||||
webAppButton("Open WebApp", WebAppInfo(args[1]))
|
||||
@ -111,6 +113,15 @@ suspend fun main(vararg args: String) {
|
||||
|
||||
)
|
||||
}
|
||||
onBaseInlineQuery {
|
||||
answerInlineQuery(
|
||||
it,
|
||||
button = InlineQueryResultsButton.invoke(
|
||||
"Open webApp",
|
||||
WebAppInfo(args[1])
|
||||
)
|
||||
)
|
||||
}
|
||||
onUnhandledCommand {
|
||||
reply(
|
||||
it,
|
||||
|
@ -5,7 +5,7 @@ org.gradle.jvmargs=-Xmx2g
|
||||
|
||||
|
||||
kotlin_version=1.8.20
|
||||
telegram_bot_api_version=7.1.0-branch_7.1.0-build1602
|
||||
telegram_bot_api_version=7.1.0-branch_7.1.0-build1610
|
||||
micro_utils_version=0.17.8
|
||||
serialization_version=1.5.0
|
||||
ktor_version=2.3.0
|
||||
|
Loading…
Reference in New Issue
Block a user