@wzzhaoyi/direct-relay
v0.2.1
Published
Lightweight message relay plugin for OpenClaw — push notifications to QQBot, Telegram, Discord, Slack, Signal, WhatsApp, iMessage and Line, bypassing LLM
Maintainers
Readme
openclaw-direct-relay
轻量级 OpenClaw 插件 — 绕过 LLM,直接将通知推送到各消息平台。
支持的 channel
| channel 值 | 平台 | 说明 |
|-------------|------|------|
| telegram | Telegram | 需在 OpenClaw 中配置 Telegram channel |
| discord | Discord | 需在 OpenClaw 中配置 Discord channel |
| slack | Slack | 需在 OpenClaw 中配置 Slack channel |
| signal | Signal | 需在 OpenClaw 中配置 Signal channel |
| whatsapp | WhatsApp | 需在 OpenClaw 中配置 WhatsApp channel |
| imessage | iMessage | 需在 OpenClaw 中配置 iMessage channel |
| line | LINE | 需在 OpenClaw 中配置 LINE channel |
| qqbot | QQ 机器人 | 需在配置中填写 appId + clientSecret |
安装
openclaw plugins install @wzzhaoyi/direct-relay配置
插件本身无独立配置项,复用 OpenClaw 已有的 channel 配置。
QQBot 需在 openclaw.json 中额外添加:
{
"channels": {
"qqbot": {
"appId": "YOUR_APP_ID",
"clientSecret": "YOUR_CLIENT_SECRET"
}
}
}认证 token 读取自 OpenClaw 配置的 hooks.token,或环境变量 OPENCLAW_HOOKS_TOKEN。
API
POST /relay
请求头
| Header | 说明 |
|--------|------|
| x-openclaw-token | 认证 token(或 Authorization: Bearer <token>) |
| Content-Type | application/json |
请求体
{
"channel": "telegram",
"to": "CHAT_ID",
"text": "消息内容"
}to 格式说明
| Channel | 格式 | 示例 |
|---------|------|------|
| telegram | Telegram chat ID | 123456789 |
| discord | 频道或用户 ID | channel:123456789 |
| slack | 频道或用户 | #general / U12345 |
| signal | 手机号 | +8613800000000 |
| whatsapp | 手机号 | +8613800000000 |
| imessage | 手机号或邮箱 | +8613800000000 |
| line | 用户/群组 ID | U1234... |
| qqbot | c2c:<openid> 或 group:<group_openid> | c2c:OPENID |
响应
{ "ok": true, "channel": "telegram" }使用示例
# Telegram
curl -X POST http://127.0.0.1:18789/relay \
-H "x-openclaw-token: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"channel":"telegram","to":"123456789","text":"备份完成"}'
# QQBot 私聊
curl -X POST http://127.0.0.1:18789/relay \
-H "x-openclaw-token: YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{"channel":"qqbot","to":"c2c:OPENID","text":"服务器告警"}'更多示例见 examples/ 目录。
License
MIT
