Telegram Bot No Response

Fix Telegram bots that don't respond to messages.

Telegram Bot No Response

Your Telegram bot isn't responding to messages? Here's how to diagnose and fix it.

Symptoms

  • Bot shows as online but doesn't reply
  • Messages show as delivered but no response
  • Bot was working before but stopped

Likely Causes

  1. Webhook not configured or pointing to wrong URL
  2. SSL certificate issues
  3. Bot token invalid or revoked
  4. Moltbot not processing Telegram messages
  5. Rate limited by Telegram
  6. Privacy mode blocking group messages

Fix Steps

1. Check Webhook Status

curl "https://api.telegram.org/bot<YOUR_TOKEN>/getWebhookInfo"

Look for:

  • "url": Should be your webhook URL
  • "has_custom_certificate": false (unless using self-signed)
  • "pending_update_count": High number = messages queued
  • "last_error_message": Shows why webhooks are failing

2. Verify Bot Token

curl "https://api.telegram.org/bot<YOUR_TOKEN>/getMe"

Should return bot info. If "Unauthorized", get new token from @BotFather.

3. Test Webhook URL Manually

curl -X POST https://your-domain.com/api/telegram/webhook \
  -H "Content-Type: application/json" \
  -d '{"update_id":1,"message":{"message_id":1,"chat":{"id":123},"text":"test"}}'

Check Moltbot logs for the request:

docker logs -f moltbot | grep -i telegram

4. Re-register Webhook

# Delete old webhook
curl "https://api.telegram.org/bot<TOKEN>/deleteWebhook"

# Wait a moment
sleep 2

# Set new webhook
curl "https://api.telegram.org/bot<TOKEN>/setWebhook?url=https://your-domain.com/api/telegram/webhook"

5. Check Privacy Mode (For Groups)

If bot only fails in groups:

  1. Message @BotFather
  2. Send /mybots
  3. Select your bot
  4. Go to "Bot Settings" → "Group Privacy"
  5. Turn OFF to receive all messages

6. Check Rate Limits

If you've been sending many messages, you might be rate limited:

  • Wait 1 hour
  • Check getWebhookInfo for "retry_after" field

7. Verify Moltbot Configuration

# Check environment variables
docker exec moltbot env | grep TELEGRAM

# Should show:
# TELEGRAM_BOT_TOKEN=123456789:ABCxxx
# TELEGRAM_WEBHOOK_URL=https://your-domain.com/api/telegram/webhook

Verify

After fixing:

  1. Send message to bot
  2. Check logs immediately:
    docker logs -f moltbot
  3. Should see "Received message from..." in logs
  4. Bot should respond within seconds

Common Mistakes

Using HTTP instead of HTTPS: Telegram requires HTTPS with valid certificate.

Webhook URL has typo: Double-check the exact path in your Moltbot config.

Bot token contains extra spaces: Copy token carefully, no leading/trailing spaces.

Using polling in development, webhooks in production: You can't use both. If Moltbot is configured for polling, webhooks won't work.