Telegram Não Responde — Solução Bot
Como resolver quando o bot do Telegram para de responder. Diagnóstico e soluções.
⏱️ 2 min de leitura
Telegram Não Responde
Seu bot do Telegram parou de responder? Veja como resolver.
Diagnóstico Rápido
1. Verificar Status
openclaw telegram status
Deve mostrar: “Connected” ✓
2. Verificar Logs
openclaw logs | grep -i telegram | tail -20
Procure por erros ou desconexões.
3. Testar Token
curl "https://api.telegram.org/bot<SEU_TOKEN>/getMe"
Deve retornar informações do bot.
Causas e Soluções
Token Inválido
Sintoma:
Error: 401 Unauthorized
Solução:
- Vá ao @BotFather no Telegram
/mybots> Seu bot > API Token- Revoke token e crie novo
- Atualize config.yaml:
telegram:
token: "novo-token"
openclaw gateway restart
Bot Bloqueado/Deletado
Sintoma: Token funciona no curl mas bot não responde.
Solução:
- Verifique se o bot existe (@BotFather > /mybots)
- Se deletado, crie novo bot
- Se bloqueado por spam, aguarde ou contate Telegram
Webhook vs Polling Conflito
Sintoma: Respostas intermitentes ou duplicadas.
Solução: Use apenas um método.
# config.yaml - polling (recomendado para início)
telegram:
method: polling
# OU webhook (produção)
telegram:
method: webhook
webhook_url: "https://seu-dominio.com/telegram"
# Limpar webhook anterior
curl "https://api.telegram.org/bot<TOKEN>/deleteWebhook"
Gateway Não Está Rodando
Sintoma: Nenhum log, nenhuma atividade.
Solução:
# Verificar processo
ps aux | grep openclaw
# Se não estiver rodando
openclaw gateway start
Telegram API Fora do Ar
Sintoma: Funciona intermitentemente.
Verificar:
- Telegram Status
- Geralmente resolve sozinho
Rate Limit
Sintoma:
Error: 429 Too Many Requests
Solução:
- Aguarde o tempo indicado
- Reduza frequência de mensagens
- Configure rate limiting:
telegram:
rate_limit:
messages_per_second: 1
messages_per_minute: 20
Configuração Correta
# config.yaml - exemplo completo
telegram:
enabled: true
token: ${TELEGRAM_BOT_TOKEN}
method: polling # ou webhook
# Se usando webhook
webhook_url: "https://seu-dominio.com/telegram/webhook"
# Opções
parse_mode: "Markdown"
drop_pending_updates: true # Ignora msgs antigas ao iniciar
Verificações Manuais
Testar Bot Diretamente
# Enviar mensagem de teste
curl -X POST "https://api.telegram.org/bot<TOKEN>/sendMessage" \
-d "chat_id=<SEU_CHAT_ID>&text=Teste"
Ver Updates Pendentes
curl "https://api.telegram.org/bot<TOKEN>/getUpdates"
Reinício Limpo
# 1. Parar gateway
openclaw gateway stop
# 2. Limpar webhook (se usando polling)
curl "https://api.telegram.org/bot<TOKEN>/deleteWebhook?drop_pending_updates=true"
# 3. Reiniciar
openclaw gateway start
# 4. Monitorar
openclaw logs -f | grep telegram
Quando Escalar
Se nada funcionar:
- Crie novo bot com @BotFather
- Atualize token na config
- Se persistir, abra issue no GitHub