telegram-doctor
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTelegram Doctor
Telegram Doctor
Diagnose configuration and connectivity issues with Telegram integration.
诊断Telegram集成中的配置与连接问题。
When to Use
适用场景
- User says "Telegram not working" or "diagnose Telegram"
- User reports connection or authentication errors
- User says "check Telegram setup" or "troubleshoot Telegram"
- Before asking for help with Telegram issues
- When sync or other Telegram commands fail unexpectedly
- 用户反馈“Telegram无法正常工作”或“诊断Telegram”
- 用户报告连接或认证错误
- 用户提出“检查Telegram配置”或“排查Telegram问题”
- 在请求Telegram问题协助之前
- 当同步或其他Telegram命令意外失败时
How to Execute
执行方式
bash
python ${CLAUDE_PLUGIN_ROOT}/tools/telegram_doctor.pybash
python ${CLAUDE_PLUGIN_ROOT}/tools/telegram_doctor.pyWhat It Checks
检查内容
- Environment file - exists in cwd
.env - API ID - is set and numeric
TELEGRAM_API_ID - API hash - is set
TELEGRAM_API_HASH - Session string - is set and valid length
TELEGRAM_SESSION - Authentication - Credentials can connect to Telegram API
- Config file - exists and is valid YAML
config/agents.yaml - Group configured - A default group is selected
- Data directory - is writable
data/
- 环境文件 - 当前工作目录下存在文件
.env - API ID - 已设置且为数值类型
TELEGRAM_API_ID - API哈希值 - 已设置
TELEGRAM_API_HASH - 会话字符串 - 已设置且长度有效
TELEGRAM_SESSION - 认证验证 - 凭证可连接至Telegram API
- 配置文件 - 存在且为有效的YAML格式
config/agents.yaml - 群组配置 - 已选择默认群组
- 数据目录 - 目录可写入
data/
Output
输出结果
Displays results with:
- ✓ for passed checks
- ✗ for failed checks
For each failure, provides a suggested fix that the user can run manually.
Important: This tool only diagnoses issues - it does not modify any files.
结果展示规则:
- ✓ 表示检查通过
- ✗ 表示检查未通过
对于每项未通过的检查,会提供用户可手动执行的修复建议。
注意: 该工具仅用于诊断问题,不会修改任何文件。
Example Output
输出示例
telegram-doctor results:
✓ Environment file (.env found)
✓ API ID (12345678)
✓ API hash (abc123...xyz9)
✗ Session string (Session appears too short)
✗ Config file (config/agents.yaml not found)
✗ Group configured (No default group set)
✓ Data directory (./data)
Some checks failed. Suggested fixes:
• Session string:
Generate a fresh session: python scripts/generate_session.py
• Config file:
Run telegram-init to create the config file
• Group configured:
Run telegram-init to select a group
(Run these steps manually - doctor does not modify files)telegram-doctor results:
✓ Environment file (.env found)
✓ API ID (12345678)
✓ API hash (abc123...xyz9)
✗ Session string (Session appears too short)
✗ Config file (config/agents.yaml not found)
✗ Group configured (No default group set)
✓ Data directory (./data)
Some checks failed. Suggested fixes:
• Session string:
Generate a fresh session: python scripts/generate_session.py
• Config file:
Run telegram-init to create the config file
• Group configured:
Run telegram-init to select a group
(Run these steps manually - doctor does not modify files)Next Steps
后续步骤
After fixing issues:
- Run to reconfigure if needed
telegram-init - Run to test connectivity
telegram-sync
修复问题后:
- 若需重新配置,执行
telegram-init - 执行测试连接情况
telegram-sync