Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

InlineKeyboardButton web_app #698

Open
zy2203 opened this issue Jan 14, 2024 · 6 comments
Open

InlineKeyboardButton web_app #698

zy2203 opened this issue Jan 14, 2024 · 6 comments

Comments

@zy2203
Copy link

zy2203 commented Jan 14, 2024

At InlineKeyboardButton, has field web_app, but here not have.

@dpominov
Copy link

dpominov commented Feb 9, 2024

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
Copy link

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
Copy link

When is the WebApp planned to be released?

@hyonosake
Copy link

@rays1410 y ist that so tho..? 😞

Took me a while to come up with that

@song-without-words
Copy link

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
Copy link

dpominov commented Sep 2, 2024

Sorry, I can't find the MenuButton

Use master branch #698 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants