|
|
|
|
|
# 桐哥 - Telegram 配对指南
|
|
|
|
|
|
|
|
|
|
|
|
## 🤖 Bot 信息
|
|
|
|
|
|
|
|
|
|
|
|
- **Bot Token:** `8719964249:AAGy4GEqZ1mMOhTKYt5iPD1FcYtpuIDUdCk`
|
|
|
|
|
|
- **Gateway 端口:** 18790
|
|
|
|
|
|
- **配对模式:** `dmPolicy: pairing` (需要主动配对才能接收私信)
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## 📱 配对步骤
|
|
|
|
|
|
|
|
|
|
|
|
### 方法 1: 通过 OpenClaw Control UI (推荐)
|
|
|
|
|
|
|
|
|
|
|
|
1. 打开 OpenClaw Control UI: `http://100.115.94.1:18790`
|
|
|
|
|
|
2. 进入 **Devices** 或 **配对** 页面
|
|
|
|
|
|
3. 点击 **Pair New Device**
|
|
|
|
|
|
4. 在 Telegram 中搜索并打开桐哥的 Bot
|
|
|
|
|
|
5. 发送任意消息给 Bot
|
|
|
|
|
|
6. 在 Control UI 中确认配对请求
|
|
|
|
|
|
|
|
|
|
|
|
### 方法 2: 通过 Telegram Bot
|
|
|
|
|
|
|
|
|
|
|
|
1. 在 Telegram 中搜索桐哥的 Bot(需要通过 token 找到 Bot 用户名)
|
|
|
|
|
|
2. 发送 `/start` 开始对话
|
|
|
|
|
|
3. Bot 会回复配对码或链接
|
|
|
|
|
|
4. 在 Control UI 中输入配对码完成配对
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## 🔧 技术细节
|
|
|
|
|
|
|
|
|
|
|
|
### 当前配置
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"channels": {
|
|
|
|
|
|
"telegram": {
|
|
|
|
|
|
"enabled": true,
|
|
|
|
|
|
"dmPolicy": "pairing",
|
|
|
|
|
|
"botToken": "8719964249:AAGy4GEqZ1mMOhTKYt5iPD1FcYtpuIDUdCk",
|
|
|
|
|
|
"groupPolicy": "allowlist"
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
### 如果想改为开放模式(无需配对)
|
|
|
|
|
|
|
|
|
|
|
|
修改 `/root/.openclaw-tongge/openclaw.json`:
|
|
|
|
|
|
|
|
|
|
|
|
```json
|
|
|
|
|
|
{
|
|
|
|
|
|
"channels": {
|
|
|
|
|
|
"telegram": {
|
|
|
|
|
|
"dmPolicy": "open" // 改为 open
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
然后重启服务:
|
|
|
|
|
|
```bash
|
|
|
|
|
|
systemctl --user restart openclaw-gateway-tongge.service
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## 📝 注意事项
|
|
|
|
|
|
|
|
|
|
|
|
1. **配对是一次性的** — 配对后设备会被记住
|
|
|
|
|
|
2. **独立于 Eason** — 桐哥的 Telegram Bot 和 Eason 的是两个不同的 Bot
|
|
|
|
|
|
3. **记忆隔离** — 桐哥的对话记忆通过 `agent_id: tongge` 逻辑隔离
|
|
|
|
|
|
4. **共享基础设施** — 使用同一个 Qdrant Collection (`mem0_v4_shared`),但元数据不同
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
## 🆘 故障排查
|
|
|
|
|
|
|
|
|
|
|
|
### Bot 无响应
|
|
|
|
|
|
|
|
|
|
|
|
1. 检查服务状态:`systemctl --user status openclaw-gateway-tongge`
|
|
|
|
|
|
2. 查看日志:`journalctl --user -u openclaw-gateway-tongge -f`
|
|
|
|
|
|
3. 验证端口:`ss -tlnp | grep 18790`
|
|
|
|
|
|
|
|
|
|
|
|
### 配对失败
|
|
|
|
|
|
|
|
|
|
|
|
1. 确认 Bot Token 正确
|
|
|
|
|
|
2. 检查 Telegram Bot 是否已被其他服务占用
|
|
|
|
|
|
3. 尝试在 Control UI 中删除旧配对,重新配对
|
|
|
|
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
|
|
|
|
**最后更新:** 2026-03-06
|
|
|
|
|
|
**维护者:** Eason (陈医生) 👨⚕️
|