Closed hamidreza01 closed 1 year ago
hello I need help answering inline query, no functional, no constructor, nothing! Please show me a code sample of answering inline query if possible.
CallbackConfig is the response type for CallbackQueries. Here's an example on how to use it:
responseMsg := tgbotapi.NewCallbackWithAlert(update.CallbackQuery.ID, "A callback response")
if _, err := bot.Request(responseMsg); err != nil {
log.Panic(err)
}
Check out wiki
https://github.com/go-telegram-bot-api/telegram-bot-api/wiki/Simple-Inline-Keyboard
I believe hamidreza01 is talking about the inline mode for the bot and the inline queries in particular
Check out wiki https://github.com/go-telegram-bot-api/telegram-bot-api/wiki/Simple-Inline-Keyboard
I believe hamidreza01 is talking about the inline mode for the bot and the inline queries in particular
Yes exactly, it is different from inline keyboards
updates := bot.ListenForWebhook("/" + bot.Token)
for update := range updates {
if update.InlineQuery == nil {
continue
}
result := tgbotapi.InlineQueryResultArticle{
Type: "article",
ID: "*UNIQUE_ID*",
Title: "Title",
InputMessageContent: tgbotapi.InputTextMessageContent{
Text: "text inserted after clicking on the result",
},
}
_, err := bot.Send(tgbotapi.InlineConfig{
InlineQueryID: update.InlineQuery.ID,
Results: []interface{}{result},
CacheTime: 60,
IsPersonal: true,
})
}
updates := bot.ListenForWebhook("/" + bot.Token) for update := range updates { if update.InlineQuery == nil { continue } result := tgbotapi.InlineQueryResultArticle{ Type: "article", ID: "*UNIQUE_ID*", Title: "Title", InputMessageContent: tgbotapi.InputTextMessageContent{ Text: "text inserted after clicking on the result", }, } _, err := bot.Send(tgbotapi.InlineConfig{ InlineQueryID: update.InlineQuery.ID, Results: []interface{}{result}, CacheTime: 60, IsPersonal: true, }) }
Yes, that is exactly right, thank you
hello I need help answering inline query, no functional, no constructor, nothing! Please show me a code sample of answering inline query if possible.