通过OpenClaw的openclaw-weixin通道主动发送微信消息。
本Skill利用OpenClaw Gateway与微信客户端的WebSocket连接,通过发送特定格式的消息包实现主动推送。
```bash
openclaw gateway status
```
openclaw-weixin 插件已启用# 使用脚本发送
python3 scripts/send_message.py --to "联系人备注名" --text "消息内容"
# 示例
python3 scripts/send_message.py --to "张三" --text "你好,这是一条测试消息"
python3 scripts/send_message.py --to "联系人备注名" --image "/path/to/image.jpg"
python3 scripts/send_message.py --to "联系人备注名" --file "/path/to/document.pdf"
| 限制项 | 说明 |
|---|---|
| ------- | ------ |
| 联系人白名单 | 只能发送给已存在的聊天对象 |
| 频率限制 | 个人号20条/分钟,超过会被限制 |
| 内容审核 | 敏感词会被拦截 |
| 用户确认 | 首次使用需用户显式授权 |
POST http://127.0.0.1:18789/api/wechat/send
Content-Type: application/json
{
"channel": "openclaw-weixin",
"recipient": {
"type": "user", // user | group
"name": "联系人备注名"
},
"message": {
"type": "text", // text | image | file
"content": "消息内容"
}
}
{
"success": true,
"messageId": "msg-xxx",
"timestamp": 1701234567890
}
| 错误码 | 说明 | 解决方案 |
|---|---|---|
| ------- | ------ | --------- |
E001 | 未登录微信 | 检查微信通道状态 |
E002 | 联系人不存在 | 确认备注名正确,或先接收对方消息 |
E003 | 频率限制 | 等待60秒后重试 |
E004 | 消息内容违规 | 检查敏感词 |
scripts/send_message.py - 发送消息主脚本scripts/contact_manager.py - 联系人管理scripts/auth_helper.py - 授权验证references/wechat-api.md - 微信API详细说明references/rate-limits.md - 频率限制详情共 1 个版本