Telegram-WebApp-Bot
Telegram-WebApp-Bot copied to clipboard
Simple Telegram WebApp Bot
Simple Telegram Web App Bot
- Clone repo.
- Edit
.env-examplefile, rename it to.env, paste BOT_TOKEN from https://t.me/botfather and paste ENDPOINT (your SERVER DOMAIN to accept requests). - Setup server to accept requests on port
45678(You can change port indocker-compose.ymlandmain.py:84). - Now you can: start
main.pymanually (not recommended) OR usedeploy.shto startBotinDocker(recommended) - Finally, go to bot PM and use
/start
Problems
WebApp doesn't work in web.telegram.org
:tipping_hand_man: If you use WebApp through the web.telegram.org, then Nginx will be very reluctant to give statics (WILL NOT).
:monocle_face: This is caused by the iframe security policy, which needs to be slightly adjusted in the Nginx settings.
:white_check_mark: I am attaching a solution to the problem in the screenshot. If you have security settings defined in Nginx, then look for such a setting in your configs and edit it as in my screenshot.
:warning: Don't forget to use nginx -s reload to update your config changes!
:sunglasses: As a result, Nginx will be happy to share static files with users of the web.telegram.org

White Screen in TDesktop
:tipping_hand_man: TDesktop on a PC does not know how to use TLS 1.3, so be sure to specify the ability to use TLS 1.2 in the Nginx config.
P.S. :confused: Now it seems too early for TLS 1.3