Channel API

管理外部通道连接(QQ、Telegram 等)的 API 端点。

通道状态

Get Channel Status

GET /api/channels/status
Response: {
  "status": "ok",
  "platforms": {
    "qq": { "connected": true, "platform": "qq" },
    "telegram": { "connected": false, "platform": "telegram" }
  },
  "running": true
}

通道控制

Start Channel

POST /api/channels/start?platform=qq
Response: { "status": "ok", "platform": "qq", "message": "已启动" }

Stop Channel

POST /api/channels/stop?platform=qq
Response: { "status": "ok", "platform": "qq", "message": "已停止" }

Reload Channel

POST /api/channels/reload?platform=qq
Response: { "status": "ok", "platform": "qq", "message": "正在重连中..." }

QR Code Login

WeChat QR Code

GET /api/channels/weixin/qrcode
Response: {
  "qrcode_url": "https://...",
  "expires_at": 1234567890
}

WeChat QR Code Status

GET /api/channels/weixin/qrcode/status?qrcode=xxx
Response: { "status": "scanned|confirmed|expired", "wx_id": "..." }

QQ QR Code

GET /api/channels/qq/qrcode
Response: {
  "image_base64": "...",
  "task_id": "...",
  "key": "..."
}

QQ QR Code Status

GET /api/channels/qq/qrcode/status?task_id=xxx&key=xxx
Response: { "status": "waiting|scanned|confirmed|cancelled" }

Client

Client Log

POST /api/channels/client-log
Body: {
  "level": "error",
  "message": "Error description",
  "stack": "stack trace"
}
Response: { "success": true }