Install
openclaw skills install wecom-post-in-groupThis skill should be used when users want to set up scheduled or recurring content push to WeChat Work group webhooks. It supports flexible scheduling including daily, weekly, monthly (specific date), and advanced patterns like last Monday of each month. Trigger phrases include webhook推送, 定时推送, 推送到企微, 企微群机器人, scheduled push, periodic webhook, 按天推送, 按周推送, 按月推送.
openclaw skills install wecom-post-in-groupProvide a complete workflow for setting up scheduled content push to WeChat Work (企业微信) group webhooks. This skill handles webhook configuration, flexible schedule patterns, content formatting, and automation creation.
Extract the webhook information from user input. The webhook can be provided in multiple formats:
https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxadeee643-bc8e-4ad1-bb52-83001cd5986eIf provided as key only, construct the full URL:
https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={KEY}
To validate the webhook, run the validation script:
python3 {SKILL_DIR}/scripts/validate_webhook.py <webhook_url_or_key>
Parse the user's desired schedule into one of the supported patterns. Refer to references/schedule_patterns.md for the full mapping of natural language to RRULE + date-guard logic.
Supported schedule types:
| Type | Examples | Implementation |
|---|---|---|
| Daily | 每天、每日、daily | RRULE: FREQ=HOURLY;INTERVAL=24 |
| Weekly | 每周一、每周五、weekly on Monday | RRULE: FREQ=WEEKLY;BYDAY=MO;BYHOUR=10;BYMINUTE=0 |
| Monthly (fixed date) | 每月1日、每月27号、monthly on the 15th | RRULE: FREQ=HOURLY;INTERVAL=24 + date guard day == N |
| Monthly (pattern) | 每月最后一周的周一、first Monday of each month | RRULE: FREQ=WEEKLY;BYDAY=MO;BYHOUR=10;BYMINUTE=0 + date guard |
Date guard logic for monthly patterns (used in automation prompt):
首先检查今天的日期,如果今天不是每月的 {N} 日,则直接结束,不执行任何操作。首先检查今天的日期,计算本月最后一个周一的日期(本月最后一天往前找到第一个周一),如果今天不是该日期,则直接结束。首先检查今天的日期,如果今天的日期不在 1-7 号之间,则直接结束。首先检查今天的日期,如果今天的日期加 7 后仍在本月内(即不是最后一周),则直接结束。Ask the user what content to push, or infer from context. Common content types:
Before creating the automation, perform a one-time test push to verify the webhook and content formatting.
Use the push script to send a test message:
python3 {SKILL_DIR}/scripts/push_to_webhook.py \
--webhook "<WEBHOOK_URL>" \
--format markdown \
--message "<FORMATTED_CONTENT>"
Or use curl directly:
curl -s '<WEBHOOK_URL>' \
-H 'Content-Type: application/json' \
-d '{"msgtype":"markdown","markdown":{"content":"<CONTENT>"}}'
Verify the response is {"errcode":0,"errmsg":"ok"}.
Use the automation_update tool with the following configuration:
mode: "suggested create"
name: <descriptive name based on content and schedule>
prompt: <date guard if needed> + <content generation steps> + <push via webhook>
rrule: <computed RRULE from Step 2>
cwds: <current workspace>
status: ACTIVE
Automation prompt template:
{DATE_GUARD_IF_NEEDED}
执行以下步骤:
1. {CONTENT_GENERATION_STEPS}
2. 将整理好的内容通过企业微信群机器人 Webhook 推送,Webhook 地址为:{WEBHOOK_URL}
3. 推送格式使用 {FORMAT},确保内容格式正确、可读性好。
After creating the automation, summarize the configuration:
WeChat Work webhook supports these message types:
{
"msgtype": "markdown",
"markdown": {
"content": "# Title\n> Quote\n**Bold** <font color=\"warning\">Warning</font>"
}
}
Supported markdown elements:
#, ##, ###**text**[text](url)> text<font color="info|comment|warning">text</font>\n{
"msgtype": "text",
"text": {
"content": "Message content",
"mentioned_list": ["@all"]
}
}