InlineKeyboardButton web_app
zy2203 opened this issue · 6 comments
zy2203 commented
At InlineKeyboardButton, has field web_app, but here not have.
dpominov commented
You can make a web app button this way:
msg := tgbotapi.NewMessage(update.Message.Chat.ID, "Hi")
msg.ReplyMarkup = tgbotapi.NewInlineKeyboardMarkup(
tgbotapi.NewInlineKeyboardRow(
tgbotapi.NewInlineKeyboardButtonWebApp("My WebApp", tgbotapi.WebAppInfo{URL: WEBAPP_URL}),
),
)You can also add a web app button to the chat menu:
mb = &tgbotapi.MenuButton{
Type: "web_app",
Text: "My WebApp",
WebApp: &tgbotapi.WebAppInfo{URL: WEBAPP_URL},
}
_, err := ba.Request(tgbotapi.SetChatMenuButtonConfig{MenuButton: mb})rays1410 commented
If you wondering why you do not have WebApp related stuff in your version of library, you should try to install the master's version, not the latest tag.
Use go get -u github.com/go-telegram-bot-api/telegram-bot-api/v5@master
monoflash commented
When is the WebApp planned to be released?
song-without-words commented
You can make a web app button this way:
msg := tgbotapi.NewMessage(update.Message.Chat.ID, "Hi") msg.ReplyMarkup = tgbotapi.NewInlineKeyboardMarkup( tgbotapi.NewInlineKeyboardRow( tgbotapi.NewInlineKeyboardButtonWebApp("My WebApp", tgbotapi.WebAppInfo{URL: WEBAPP_URL}), ), )You can also add a web app button to the chat menu:
mb = &tgbotapi.MenuButton{ Type: "web_app", Text: "My WebApp", WebApp: &tgbotapi.WebAppInfo{URL: WEBAPP_URL}, } _, err := ba.Request(tgbotapi.SetChatMenuButtonConfig{MenuButton: mb})
You can make a web app button this way:
msg := tgbotapi.NewMessage(update.Message.Chat.ID, "Hi") msg.ReplyMarkup = tgbotapi.NewInlineKeyboardMarkup( tgbotapi.NewInlineKeyboardRow( tgbotapi.NewInlineKeyboardButtonWebApp("My WebApp", tgbotapi.WebAppInfo{URL: WEBAPP_URL}), ), )You can also add a web app button to the chat menu:
mb = &tgbotapi.MenuButton{ Type: "web_app", Text: "My WebApp", WebApp: &tgbotapi.WebAppInfo{URL: WEBAPP_URL}, } _, err := ba.Request(tgbotapi.SetChatMenuButtonConfig{MenuButton: mb})
Sorry, I can't find the MenuButton
dpominov commented
Sorry, I can't find the MenuButton
Use master branch #698 (comment)