Webhook Not Firing
Diagnose and fix issues with Telegram/Discord webhooks not triggering.
Webhook Not Firing
Your bot doesn't respond to messages? The webhook might not be configured correctly.
Symptoms
- Bot shows as online but doesn't respond
- Messages are sent but nothing happens
- No errors in logs when messages are sent
Likely Causes
- Webhook URL incorrect or not set
- SSL certificate invalid (required for Telegram)
- Firewall blocking incoming connections
- Webhook secret mismatch
- Bot token revoked or invalid
Fix Steps
1. Verify Webhook is Set
For Telegram:
curl "https://api.telegram.org/bot<YOUR_TOKEN>/getWebhookInfo"Check the response:
urlshould be your webhook URLlast_error_messageshows any issuespending_update_countshows queued messages
For Discord: Discord uses gateway connection, not webhooks. Check if bot is connected:
docker logs moltbot | grep -i discord2. Check SSL Certificate
Telegram requires valid HTTPS:
curl -I https://your-domain.com/api/telegram/webhookShould return 200 OK. If certificate errors, see Reverse Proxy Setup.
3. Check Firewall
Ensure port 443 (HTTPS) is open:
sudo ufw status
# Should show 443 ALLOWTest from outside:
curl https://your-domain.com/health4. Re-register Webhook
Telegram:
# Delete old webhook
curl "https://api.telegram.org/bot<TOKEN>/deleteWebhook"
# Set new webhook
curl "https://api.telegram.org/bot<TOKEN>/setWebhook?url=https://your-domain.com/api/telegram/webhook"5. Check Logs
docker logs -f moltbot 2>&1 | grep -i "webhook\|telegram\|discord"Look for:
- "Webhook received" - confirms messages are arriving
- Error messages about parsing or handling
Verify
Send a test message to your bot. You should see log output:
Webhook received from Telegram
Processing message from user: 123456Common Mistakes
Using HTTP instead of HTTPS: Telegram only accepts HTTPS webhooks with valid certificates.
Wrong webhook path: Double-check the path matches your Moltbot configuration.
Cloudflare/proxy issues: If using Cloudflare, ensure it's not blocking webhook requests or requiring captchas.