The Web App provides a rich in-app interface for scanning URLs directly within Telegram.
-
Push to GitHub:
git add webapp/scanner.html git commit -m "Add Telegram Web App" git push origin main -
Enable GitHub Pages:
- Go to https://github.com/Masterofowls/API_Bot/settings/pages
- Source: "Deploy from a branch"
- Branch:
main - Folder:
/ (root) - Click "Save"
-
Get URL:
- Your Web App will be at:
https://masterofowls.github.io/API_Bot/webapp/scanner.html - Wait 2-3 minutes for deployment
- Your Web App will be at:
-
Update Bot:
- Edit
bot.pyline 67 - Change
webapp_urlto:https://masterofowls.github.io/API_Bot/webapp/scanner.html - Commit and push
- Edit
-
Sign up: https://netlify.com
-
Deploy:
- New site from Git
- Connect GitHub
- Select
API_Botrepo - Build command: (leave empty)
- Publish directory:
webapp - Deploy
-
Get URL:
- Copy the Netlify URL (e.g.,
https://api-bot-scanner.netlify.app/scanner.html)
- Copy the Netlify URL (e.g.,
-
Update bot.py:
- Change
webapp_urlto your Netlify URL
- Change
-
Install Vercel CLI:
npm install -g vercel
-
Deploy:
cd webapp vercel --prod -
Use the provided URL
✅ Single Scan - Scan one URL with full analysis
✅ Batch Scan - Scan up to 10 URLs simultaneously
✅ Deep Scan - Crawl and scan linked pages
✅ Telegram Theme - Automatically matches user's Telegram theme
✅ Haptic Feedback - Native feel with vibration feedback
✅ Progress Tracking - Real-time scan progress
✅ Responsive Design - Works on all devices
-
Serve locally:
cd webapp python -m http.server 8000 -
Use ngrok for testing:
ngrok http 8000
-
Update bot.py with ngrok URL (temporary)
- WebApp.expand() - Full screen
- WebApp.sendData() - Send scan requests to bot
- WebApp.themeParams - Auto theme matching
- WebApp.HapticFeedback - Vibration feedback
- WebApp.enableClosingConfirmation() - Prevent accidental close
Web App button not appearing?
- Make sure you pushed changes to bot.py
- Check Render deployed the latest code
- Restart bot if needed
Web App not loading?
- Verify URL is accessible (open in browser)
- Check HTTPS is enabled
- GitHub Pages may take 5-10 minutes to activate
Theme not applying?
- Web App automatically uses Telegram theme
- Works on Telegram mobile and desktop
Scans not working?
- Check bot receives data (check Render logs)
- Verify WebApp handler is registered
- Test with
/startcommand first
User clicks "🌐 Open Web Scanner"
↓
Telegram opens Web App (scanner.html)
↓
User fills form and clicks "Start Scan"
↓
Web App sends data to bot via WebApp.sendData()
↓
Bot receives in handle_webapp_data()
↓
Bot processes scan and sends results back
- ✅ WebApp data is validated by Telegram
- ✅ All URLs are sanitized before scanning
- ✅ Rate limiting applies to WebApp requests
- ✅ HTTPS required for production
- Deploy Web App to GitHub Pages
- Update
webapp_urlin bot.py - Push changes and wait for Render deployment
- Test with
/startcommand - Click "🌐 Open Web Scanner" button
Edit webapp/scanner.html to:
- Change colors and styling
- Add more scan options
- Customize progress animations
- Add result visualization
Remember to redeploy after changes!