1.2 KiB
1.2 KiB
Song Selection Issue Analysis
Problem
- Production: Song selection says it will send to chat but doesn't actually send
- /start command works fine
- No errors in logs
Code Flow Analysis
Working /start Command (src/bot.ts:66-95)
- User sends /start command
- Bot receives via
this.bot.onText(/\/start/) - Direct bot.sendMessage() call works
Broken Song Selection Flow
- User selects song in Web App (public/script.ts:248)
- Web App calls
this.tg.sendData()with JSON payload - Should trigger
web_app_dataevent in bot (src/bot.ts:159) - Bot should call
sendAudioFile()method (src/bot.ts:224)
Key Differences
- /start: Direct Telegram command → immediate bot response
- Song selection: Web App → sendData() → web_app_data event → bot response
Potential Issues
this.tg.sendData()might not be working in production environmentweb_app_dataevent handler might not be triggered- Web App URL environment variable mismatch
- Telegram Web App integration issues in production
Next Steps
- Check production environment variables (WEB_APP_URL, TELEGRAM_BOT_TOKEN)
- Add logging to web_app_data handler
- Verify Telegram Web App configuration