Make a Telegram Web Apps for Bots

. . . .

This is a Telegram Web Apps example, I use Cloudflare workers as my web server and bot server. This example can open a web app and return user input to bot, and bot can show user input on Telegram chat.


Please click article button on bottom left of the


  1. Create two new Cloudflare workers and paste below code
  2. Create a new Telegram Bot in
  3. Edit Telegram Bot's menu button in BotFather : /mybots > <MyBot> > Bot Settings > Menu Button > Edit Menu button URL > <Your cloudflare workers front end url (ex:>
  4. Open<Telegram Bot token>/setWebhook?url=<Cloudflare workers back-end url (ex:> in broswer