telegram-bot-management
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseTelegram Bot Management
Telegram机器人管理
Overview
概述
Multi-workspace Telegram bot workflow orchestration with full supervision (launchd + watchexec). Manages the claude-orchestrator Telegram bot for headless Claude Code interactions.
基于launchd + watchexec的多工作区Telegram机器人工作流编排与全面监控。管理用于无界面Claude Code交互的claude-orchestrator Telegram机器人。
When to Use This Skill
何时使用此技能
- Check bot status, restart, or troubleshoot issues
- Monitor bot health and resource usage
- View bot logs and debug problems
- Manage bot lifecycle (start/stop/restart)
- 检查机器人状态、重启或排查问题
- 监控机器人健康状况和资源使用情况
- 查看机器人日志并调试问题
- 管理机器人生命周期(启动/停止/重启)
Production Mode
生产模式
As of v5.8.0, production mode is the only operational mode.
从v5.8.0版本开始,生产模式是唯一的运行模式。
Bot Management Commands
机器人管理命令
Check Status
检查状态
bash
bot-service.sh statusbash
bot-service.sh statusOr use alias
或使用别名
bot status
Shows:
- launchd supervision status
- watchexec process (PID, uptime, memory)
- Bot process (PID, uptime, memory)
- Full process tree
- Recent log activitybot status
显示内容:
- launchd监控状态
- watchexec进程(PID、运行时间、内存占用)
- 机器人进程(PID、运行时间、内存占用)
- 完整进程树
- 近期日志活动View Logs
查看日志
bash
bot-service.sh logsbash
bot-service.sh logsOr use alias
或使用别名
bot logs
Tails all logs:
- Launchd logs (supervision layer)
- Bot logs (application layer)bot logs
实时查看所有日志:
- Launchd日志(监控层)
- 机器人日志(应用层)Restart Bot
重启机器人
bash
bot-service.sh restartbash
bot-service.sh restartOr use alias
或使用别名
bot restart
Rarely needed due to automatic code reload via watchexec.bot restart
由于watchexec会自动重新加载代码,因此很少需要执行此操作。Stop Bot
停止机器人
bash
bot-service.sh stopbash
bot-service.sh stopOr use alias
或使用别名
bot stop
---bot stop
---Reference Documentation
参考文档
For detailed information, see:
- Operational Commands - Status, restart, logs, monitoring commands
- Troubleshooting - Common issues and diagnostic steps
如需详细信息,请查看:
- 操作命令 - 状态、重启、日志、监控命令
- 故障排查 - 常见问题和诊断步骤
Troubleshooting
故障排查
| Issue | Cause | Solution |
|---|---|---|
| Bot not responding | Process crashed | Run |
| launchd not starting | Service not loaded | Load with |
| Logs empty | Log rotation or path issue | Verify log path in launchd plist |
| watchexec not reloading | File patterns not matching | Check watchexec filter patterns |
| High memory usage | Memory leak in bot code | Restart bot, investigate Python memory usage |
| Permission denied | Script not executable | Run |
| Environment vars missing | .env not loaded | Verify environment setup in launchd plist |
| Multiple bot instances | Previous instance not stopped | Kill all bot processes, then restart cleanly |
| 问题 | 原因 | 解决方案 |
|---|---|---|
| 机器人无响应 | 进程崩溃 | 执行 |
| launchd无法启动 | 服务未加载 | 使用 |
| 日志为空 | 日志轮转或路径问题 | 验证launchd plist文件中的日志路径 |
| watchexec不重新加载代码 | 文件匹配模式不正确 | 检查watchexec的过滤模式 |
| 内存占用过高 | 机器人代码存在内存泄漏 | 重启机器人,排查Python内存使用情况 |
| 权限被拒绝 | 脚本无执行权限 | 执行 |
| 环境变量缺失 | .env文件未加载 | 验证launchd plist文件中的环境设置 |
| 存在多个机器人实例 | 之前的实例未停止 | 终止所有机器人进程,然后干净重启 |