/integrations:bot-debug описание проблемы или путь к bot файлуfrom Integrations & DevOps
Analyzes Telegram bot code and logs to diagnose common issues like unresponsive bots, stuck scenes, command handling bugs, middleware ordering, and memory leaks. Produces a root-cause analysis with specific fix suggestions.
Ships in Integrations & DevOps. Installing the plugin adds it to Claude Code.
Проанализируй и помоги отладить Telegram бота: $ARGUMENTS
Автоматически определи тип проблемы:
Используй telegram-bot-toolkit skill:
"Используй telegram-bot-toolkit: analyze bot code в $ARGUMENTS"
Проверь:
Symptoms: /start не работает when in conversation
Check:
# WRONG:
states={
SCENE: [
MessageHandler(filters.TEXT, handler) # catches commands!
]
}
# CORRECT:
states={
SCENE: [
MessageHandler(filters.TEXT & ~filters.COMMAND, handler)
]
}
# OR:
fallbacks=[CommandHandler('start', start)]
Symptoms: /help, /settings не работают
Check middleware order:
# Commands MUST be in lower group than conversation
app.add_handler(CommandHandler('help', help), group=1)
app.add_handler(conversation_handler, group=2)
Symptoms: "Query is too old" errors
Check:
async def button_handler(update, context):
query = update.callback_query
await query.answer() # MUST be first!
# ... rest of logic
Symptoms: Memory grows over time
Check:
# Clean up user_data periodically
async def cleanup(context):
for user_id in list(context.application.user_data.keys()):
if is_inactive(user_id):
del context.application.user_data[user_id]
If logs provided:
Log patterns to look for:
ERROR:... ConversationHandler... - Scene handling issue
ERROR:... Conflict: terminated by other getUpdates - Multiple instances
ERROR:... Network error - Connection issues
WARNING:... Callback query is too old - query.answer() missing
Quick checks:
# 1. Check if bot is running
ps aux | grep python | grep bot
# 2. Check logs
tail -f logs/bot.log
# 3. Test connection
curl https://api.telegram.org/bot<TOKEN>/getMe
# 4. Check handlers order
# Add logging to see handler execution
Test scenarios:
# 1. Test /start command
# 2. Test conversation flow
# 3. Test callback buttons
# 4. Test error handling
# 5. Test concurrent users
Generate fix based on problem type:
For scene issues:
# Add ~filters.COMMAND to text handlers
# Add proper fallbacks
# Use per_user=True in ConversationHandler
For middleware issues:
# Reorder handlers: logging(-1) → auth(0) → commands(1) → conversation(2)
For database issues:
# Check connection string
# Add retry logic
# Use connection pooling
For deployment:
# Check environment variables
# Verify webhook URL
# Test health endpoints
Create test checklist:
Best practices для избежания проблем:
# 1. Always use ~filters.COMMAND
states={
SCENE: [MessageHandler(filters.TEXT & ~filters.COMMAND, handler)]
}
# 2. Always answer callbacks
await query.answer()
# 3. Always register error handler
app.add_error_handler(error_handler)
# 4. Always log important events
logger.info(f"User {user_id} started conversation")
# 5. Always clean up user_data
# Schedule periodic cleanup
Issue Type: [type] Root Cause: [detailed explanation] Affected: [what's not working]
Quick Fix: [immediate action]
# Code changes needed
Long-term Fix: [proper solution]
# Better implementation
Test Steps:
Expected Result: [what should happen]
Best Practices: [how to avoid in future]
/bot-debug Bot застревает после /start command в your-project/backend/bot
/bot-debug Commands /help и /settings не работают, обрабатываются как text
/bot-debug Callback buttons показывают "query is too old" error
/bot-debug src/handlers/onboarding.py - users can't exit onboarding flow
Automatically uses:
Начинай debugging! 🐛
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
6 commands in this plugin
/bot-deploy🚀 Bot Deploy: $ARGUMENTSDeploy Telegram bot to production с Docker и webhook setup/bot-test🧪 Bot Test: $ARGUMENTSКомплексное тестирование Telegram бота с test scenarios/domain-dns-opsManage DNS records via Cloudflare API - list, add, update, delete records, check SSL, manage proxy. Use with /domain-dns-ops or "DNS", "домен"./outlook/outlookРабочая почта компании ([email protected]) через локальный Outlook по COM — пароль не нужен. Триггеры: «рабочая почта», «exchange». Личная → /gmail./translateПеревод через DeepL Pro: текст, formality, документы docx/pptx/pdf/xlsx. Триггеры: «переведи», «перевод документа». Массовый Google-перевод → /gtranslate.npx claudepluginhub jhamidun/claude-code-config-pack --plugin integrationsOther plugins' commands for the same job