make a web app #302
make a web app
#302
|
I can't figure out how to create a web app with sending and receiving data. Is there an example? |
Answered by
reo7sp
Sep 14, 2026
Replies: 1 comment
|
tgbot-cpp implements only the bot backend; the Web App itself is a separate HTTPS page using the Telegram Web App JavaScript API. For the simplest auto app = std::make_shared<TgBot::WebAppInfo>();
app->url = "https://example.com/app";
auto button = std::make_shared<TgBot::KeyboardButton>();
button->text = "Open app";
button->webApp = app;In JavaScript call An |
0 replies
Answer selected by
reo7sp
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tgbot-cpp implements only the bot backend; the Web App itself is a separate HTTPS page using the Telegram Web App JavaScript API.
For the simplest
sendDataflow, attach aWebAppInfoto a reply-keyboard button:In JavaScript call
Telegram.WebApp.sendData(...). The bot receives a normal message withmessage->webAppData; check it inonAnyMessageand readmessage->webAppData->data.An
InlineKeyboardButton::webAppuses the inline Web App query flow instead: send the query ID from the Web App to your ba…