Skip to content

Latest commit

 

History

History

MiniApp

Telegram.Bot Mini-App example

This example was built starting from Visual Studio template project: ASP.NET Core Web App (Razor Pages)

Minimal changes were made:

  • Program.cs: for the bot webhook and starting the example website as a Telegram Mini-App
  • _Layout.cshtml: importing required telegram-web-app.js

Now we also included the WebAppDemo and DurgerKingBot example bot (in demo.cshtml, cafe.cshtml, Cafe.cs and some wwwroot static files)

WebAppDemo & DurgerKingBot examples

Static data imported from official WebApps:

Server-side code reconstructed from above, and adapted from:

Notes

For DurgerKing to serve invoices, you will need to set a "PaymentProviderToken" in appsettings.json (typically from Stripe in TEST mode)

Sending WebAppData to bot (button "Send time to bot") works only when opening the webapp via a ReplyKeyboardButton (try using the second "Hello World!" button)