Push-Server WeCom Notification
Send notifications to WeCom (企业微信) users via the Push Server OpenAPI.
This skill is designed for push notifications powered by Push Server. It can also be adapted for other webhook notification services by modifying notify.py .
Supports TEXT, MARKDOWN, TEXT_CARD, and NEWS message types.
Acknowledgements
The current version was collaboratively refined with AI assistance. Special thanks to:
- - OpenClaw — the agent framework that powers this skill
- Qwen — AI coding assistant
Configuration
Two environment variables are required. Set them in openclaw.json:
CODEBLOCK0
- -
apiKey → automatically injected as QYWX_PUSH_API_KEY (via primaryEnv) - INLINECODE4 → the base URL of the push service
Usage
CODEBLOCK1
Environment Variables
| Variable | Required | Source | Description |
|---|
| QYWXPUSHAPIKEY | yes | INLINECODE5 | API Key for authentication (X-API-Key) |
| QYWXPUSH_URL |
yes |
skills.entries.*.env | Base URL of the push service |
Request Parameters
| Param | Type | Required | Default | Description |
|---|
| toUser | str | yes | - | Target user(s), pipe-separated, e.g. INLINECODE8 |
| msgType |
str | no | TEXT |
TEXT /
MARKDOWN /
TEXT_CARD /
NEWS |
| content | str | yes (TEXT / MARKDOWN) | - | Message content |
| title | str | TEXT_CARD only | - | Card title |
| description | str | TEXT_CARD only | - | Card description |
| url | str | TEXT_CARD only | - | Card link URL |
| btnText | str | TEXT_CARD only | View Details | Card button text |
| articles | list[obj] | NEWS only | - | List of article objects (see below) |
Article Object (NEWS)
| Param | Type | Required | Description |
|---|
| title | str | yes | Article title |
| url |
str | yes | Article link |
| description | str | no | Article description |
| picUrl | str | no | Article cover image |
Examples
CODEBLOCK2
Message Type Reference
| INLINECODE13 | Required Fields | Description |
|---|
| INLINECODE14 | INLINECODE15 | Plain text message |
| INLINECODE16 |
content | Markdown rich text |
|
TEXT_CARD |
title,
description,
url | Card message with button |
|
NEWS |
articles | News / articles |
Success Response
CODEBLOCK3
Error Response
CODEBLOCK4
Current Status
Fully functional.
Push-Server 企业微信通知
通过 Push Server OpenAPI 向企业微信用户发送通知。
该技能专为 Push Server 驱动的推送通知设计。通过修改 notify.py,也可适配其他 Webhook 通知服务。
支持 TEXT、MARKDOWN、TEXT_CARD 和 NEWS 消息类型。
致谢
当前版本在 AI 辅助下协作完善。特别感谢:
配置
需要设置两个环境变量。在 openclaw.json 中配置:
json
skills: {
entries: {
push-server-py: {
apiKey: your-api-key-here,
env: {
QYWXPUSHURL: https://push.wechat.com
}
}
}
}
- - apiKey → 自动注入为 QYWXPUSHAPIKEY(通过 primaryEnv)
- env.QYWXPUSH_URL → 推送服务的基础 URL
使用方法
bash
python3 {baseDir}/notify.py
环境变量
| 变量 | 必填 | 来源 | 描述 |
|---|
| QYWXPUSHAPIKEY | 是 | skills.entries..apiKey | 用于身份验证的 API 密钥(X-API-Key) |
| QYWXPUSH_URL |
是 | skills.entries..env | 推送服务的基础 URL |
请求参数
| 参数 | 类型 | 必填 | 默认值 | 描述 |
|---|
| toUser | str | 是 | - | 目标用户,用竖线分隔,例如 user1 | user2 |
| msgType |
str | 否 | TEXT | TEXT / MARKDOWN / TEXT_CARD / NEWS |
| content | str | 是(TEXT / MARKDOWN) | - | 消息内容 |
| title | str | 仅 TEXT_CARD | - | 卡片标题 |
| description | str | 仅 TEXT_CARD | - | 卡片描述 |
| url | str | 仅 TEXT_CARD | - | 卡片链接 URL |
| btnText | str | 仅 TEXT_CARD | 查看详情 | 卡片按钮文本 |
| articles | list[obj] | 仅 NEWS | - | 文章对象列表(见下文) |
文章对象(NEWS)
str | 是 | 文章链接 |
| description | str | 否 | 文章描述 |
| picUrl | str | 否 | 文章封面图片 |
示例
bash
发送 TEXT 通知
python3 {baseDir}/notify.py {toUser:user1,content:系统运行正常。,msgType:TEXT}
发送 MARKDOWN 通知
python3 {baseDir}/notify.py {
toUser: user1|user2,
msgType: MARKDOWN,
content: ## 🚨 告警\n\n> CPU 使用率超过
90%
}
发送 TEXT_CARD 通知
python3 {baseDir}/notify.py {
toUser: user1|user2,
msgType: TEXT_CARD,
title: 周报已就绪,
description: 点击查看本周报告。,
url: https://example.com/reports/weekly,
btnText: 查看报告
}
发送 NEWS 通知
python3 {baseDir}/notify.py {
toUser: user1|user2,
msgType: NEWS,
articles: [{
title: 三月月度报告,
url: https://example.com/reports/202503,
description: 三月报告已准备好,请审阅。,
picUrl: https://example.com/reports/202503/cover.jpg
}]
}
消息类型参考
| msgType | 必填字段 | 描述 |
|---|
| TEXT | content | 纯文本消息 |
| MARKDOWN |
content | Markdown 富文本 |
| TEXT_CARD | title, description, url | 带按钮的卡片消息 |
| NEWS | articles | 新闻/文章 |
成功响应
json
{
success: true,
message: ok,
errCode: 0
}
错误响应
json
{
success: false,
message: 发送失败:API 错误:无效的 API 密钥(errCode: 401),
errCode: 401
}
当前状态
功能完整可用。