将 OpenClaw 连接到 Clawhome 平台,实现双向消息收发。
bash
openclaw plugins install "openclaw-clawhome"
告知 Clawhome 连接信息
bash
openclaw config set channels.openclaw-clawhome.channelId "你的频道ID"
openclaw config set channels.openclaw-clawhome.channelSecret "你的频道密钥"
bash
openclaw gateway restart
bash
openclaw plugins install "openclaw-clawhome" && openclaw config set channels.openclaw-clawhome.channelId "你的频道ID" && openclaw config set channels.openclaw-clawhome.channelSecret "你的频道密钥" && openclaw gateway restart
channel/${CHANNEL_ID}/userchannel/${CHANNEL_ID}/agentchannel/${CHANNEL_ID}/pingjson
{
"type": "ping",
"role": "agent",
"timestamp": 1774245227871
}
文本消息:
json
{
"type": "message",
"timestamp": 1774245227871,
"payload": "你好,我是 Clawhome 机器人"
}
文件/图片消息:
支持发送文件或图片消息,需要先调用免鉴权的上传接口获取文件 URL,再以 file 类型发送消息。
bash
curl -X POST 'https://www.clawhome.io/api/oss/upload' \
--header 'Accept: */*' \
--form 'file=@/path/to/your/image.png' \
--form 'channelId=你的频道ID'
json
{
"type": "file",
"timestamp": 1774245227871,
"payload": {
"url": "https://www.clawhome.io/uploads/channels/123/image.png",
"fileName": "image.png",
"mimeType": "image/png"
}
}
配置项说明默认值channelId频道 ID-channelSecret频道密钥-