telegram-doctor

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Telegram 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.py
bash
python ${CLAUDE_PLUGIN_ROOT}/tools/telegram_doctor.py

What It Checks

检查内容

  1. Environment file -
    .env
    exists in cwd
  2. API ID -
    TELEGRAM_API_ID
    is set and numeric
  3. API hash -
    TELEGRAM_API_HASH
    is set
  4. Session string -
    TELEGRAM_SESSION
    is set and valid length
  5. Authentication - Credentials can connect to Telegram API
  6. Config file -
    config/agents.yaml
    exists and is valid YAML
  7. Group configured - A default group is selected
  8. Data directory -
    data/
    is writable
  1. 环境文件 - 当前工作目录下存在
    .env
    文件
  2. API ID -
    TELEGRAM_API_ID
    已设置且为数值类型
  3. API哈希值 -
    TELEGRAM_API_HASH
    已设置
  4. 会话字符串 -
    TELEGRAM_SESSION
    已设置且长度有效
  5. 认证验证 - 凭证可连接至Telegram API
  6. 配置文件 -
    config/agents.yaml
    存在且为有效的YAML格式
  7. 群组配置 - 已选择默认群组
  8. 数据目录 -
    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:
  1. Run
    telegram-init
    to reconfigure if needed
  2. Run
    telegram-sync
    to test connectivity
修复问题后:
  1. 若需重新配置,执行
    telegram-init
  2. 执行
    telegram-sync
    测试连接情况