Skip to main content

Telegram Troubleshooting

Diagnostic procedures for Telegram connection issues, including reconnection handling and rate limit recovery.

Quick Diagnostics


Symptom: Bot Not Responding

Diagnostic Steps

Common Causes


Symptom: Connection Offline

Check Token Validity

Verify Network Connectivity


Symptom: Rate Limit Errors (HTTP 429)

Rate limiting occurs when too many requests are sent to Telegram API.

Identify Rate Limiting

Immediate Recovery

  1. Wait for cooldown - Telegram rate limits typically last 1-60 seconds
  2. Do not restart repeatedly - Restarts trigger reconnection floods

Prevent Future Rate Limits

  • Avoid sending messages in tight loops
  • Use built-in throttling (enabled by default via @grammyjs/transformer-throttler)
  • For group messages, ensure proper spacing between sends

Symptom: Conflict Errors

Conflict errors occur when multiple bot instances use the same token.

Identify Conflict

Resolution


Symptom: Messages Not Delivered

Bot is connected but messages are not being received or sent.

Check Allowlist Configuration

Find Your Chat ID

Check Group Chat Settings

For group chats, verify:

Reconnection Procedures

Automatic Reconnection

The gateway automatically reconnects with exponential backoff:
  1. Disconnect detected
  2. Wait 1 second
  3. Attempt reconnection
  4. If fails, wait 2s, 4s, 8s… (max 60s)
  5. Continue until successful

Manual Reconnection

Full Re-authentication

If automatic reconnection fails repeatedly:

Monitoring Telegram Health

Key Metrics

Health Check Script


Alert Integration

Critical Telegram issues trigger alerts via the alerting system: Configure alert destinations:

Common Error Messages