webhook push

v1.0.3

多平台群机器人消息推送。支持企业微信、钉钉、飞书的 webhook 推送。当用户说"发送到微信群"、"发钉钉消息"、"推送到飞书"时使用此技能。

0· 87·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for ysjyga/webhook-push.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "webhook push" (ysjyga/webhook-push) from ClawHub.
Skill page: https://clawhub.ai/ysjyga/webhook-push
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install webhook-push

ClawHub CLI

Package manager switcher

npx clawhub@latest install webhook-push
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description match the code and SKILL.md. The skill only needs webhook keys (kept in a local webhook-config.json) and performs HTTP POSTs to the documented platform webhook endpoints. No unrelated services, binaries, or credentials are requested.
Instruction Scope
SKILL.md and README instruct the user to create webhook-config.json and show exactly which functions will be used. Runtime instructions and examples only reference reading that config and calling official webhook URLs; there is no instruction to read unrelated files, environment variables, or to transmit data to unknown endpoints.
Install Mechanism
No install spec and the script uses only Python standard library (urllib, json, base64, hashlib). Nothing is downloaded or written by an installer, so install risk is minimal.
Credentials
The skill requests no environment variables or system config paths. It reads a single local config file (webhook-config.json) which is appropriate for storing webhook keys; this is declared in SKILL.md as user-provided. The requested secrets (webhook keys) are proportional to the functionality.
Persistence & Privilege
always is false and the skill does not modify other skills or system settings. It can be invoked autonomously (platform default) but its scope and required data are limited to local webhook keys and outbound requests to the documented APIs.
Assessment
This skill appears to do exactly what it promises. Before installing: (1) store webhook-config.json securely (it contains secrets) and do not commit it to public repos; (2) review the webhook keys and consider creating dedicated bot/webhook accounts with limited permissions; (3) be aware of platform rate limits and sensitive-word filtering; (4) run the script in a trusted environment since it will read the local config and make outbound HTTP requests; (5) if you want to limit autonomous use, restrict the skill or review agent invocation policies. If you need higher assurance, inspect the provided Python file yourself or run it in an isolated environment.

Like a lobster shell, security has layers — review code before you run it.

latestvk9725z51egtyqvn7ddbc6xjc3184xk2g
87downloads
0stars
4versions
Updated 1w ago
v1.0.3
MIT-0

多平台群机器人消息推送

快速开始

首次配置

用户需要先配置各平台的 webhook key。支持的平台:

平台说明
企业微信群机器人 webhook
钉钉自定义机器人
飞书自定义机器人

将配置保存到 webhook-config.json(放在脚本同目录下):

{
  "wechat": {
    "群名称": {
      "key": "YOUR_WECHAT_KEY_HERE"
    }
  },
  "dingtalk": {},
  "feishu": {}
}

支持的平台

1. 企业微信

API 地址: https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={key}

支持的消息类型:

  • text - 文本消息(支持 @mention)
  • image - 图片(base64 + md5)
  • markdown - Markdown(部分支持)

发送示例:

import json
import urllib.request

def send_wechat(key, content):
    url = f"https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key={key}"
    data = {"msgtype": "text", "text": {"content": content}}
    
    req = urllib.request.Request(url, data=json.dumps(data, ensure_ascii=False).encode('utf-8'))
    req.add_header("Content-Type", "application/json; charset=utf-8")
    
    with urllib.request.urlopen(req) as resp:
        return json.loads(resp.read().decode('utf-8'))

2. 钉钉

API 地址: https://oapi.dingtalk.com/robot/send?access_token={key}

支持的消息类型:

  • text - 文本消息(支持 @手机号)
  • markdown - Markdown
  • link - 链接卡片
  • actionCard - ActionCard 卡片
  • feedCard - FeedCard 卡片

发送示例:

import json
import urllib.request

def send_dingtalk(key, content, at_mobiles=None):
    url = f"https://oapi.dingtalk.com/robot/send?access_token={key}"
    data = {
        "msgtype": "text",
        "text": {"content": content},
        "at": {"atMobiles": at_mobiles or []}
    }
    
    req = urllib.request.Request(url, data=json.dumps(data, ensure_ascii=False).encode('utf-8'))
    req.add_header("Content-Type", "application/json; charset=utf-8")
    
    with urllib.request.urlopen(req) as resp:
        return json.loads(resp.read().decode('utf-8'))

3. 飞书

API 地址: https://open.feishu.cn/open-apis/bot/v2/hook/{key}

支持的消息类型:

  • text - 纯文本
  • post - 富文本
  • image - 图片(需先上传获取 media_id)
  • share_chat - 分享群会话
  • interactive - 卡片消息

发送示例:

import json
import urllib.request

def send_feishu(key, content):
    url = f"https://open.feishu.cn/open-apis/bot/v2/hook/{key}"
    data = {"msg_type": "text", "content": {"text": content}}
    
    req = urllib.request.Request(url, data=json.dumps(data, ensure_ascii=False).encode('utf-8'))
    req.add_header("Content-Type", "application/json; charset=utf-8")
    
    with urllib.request.urlopen(req) as resp:
        return json.loads(resp.read().decode('utf-8'))

使用示例

用户说:「把天气发到钉钉项目群」

执行流程

  1. 从配置中查找「钉钉-项目群」对应的 key
  2. 获取天气数据
  3. 调用 send_dingtalk 发送

@mentioned 功能(企业微信)

@所有人 ✅ 推荐方式

from webhook_push import send_wechat_text

key = "YOUR_WEBHOOK_KEY"
content = "明天晚上公司聚餐,大家都来!"  # 内容里不要写 @all
send_wechat_text(key, content, mentioned_list=["@all"])

注意:内容里不要写 @all,只需要传 mentioned_list=["@all"]。如果内容里写了 @all,消息会显示两个 @all。

@个人(临时方案)

企业微信 webhook 的 @ 个人功能需要获取成员的 userid 或手机号。如果无法获取,可用以下方式:

# 在内容前面直接写 @姓名(这是临时方案,不会触发系统通知)
content = "@张三 明天上午10点开会"
send_wechat_text(key, content)

效果:消息中会显示 "@张三",但这是纯文本显示,不会触发系统的 @ 通知。

@个人(正确方式,需要 userid/手机号)

如果能获取到成员的 userid 或手机号,可以使用官方支持的 @ 方式:

# 通过 userid @(userid 需要管理员在企业微信后台获取)
send_wechat_text(key, content, mentioned_list=["userid"])

# 通过手机号 @(需要在群里绑定过手机号)
send_wechat_text(key, content, mentioned_mobile_list=["13800001111"])

注意

  • mentioned_list 里 userid 前不要加 @ 符号,如 ["wangqing"] 而不是 ["@wangqing"]
  • mentioned_list=["@all"] 里 @all 需要带 @ 符号

权限要求

群聊设置中需要开启「允许机器人 @ 所有人」权限(需群主/管理员操作)。


常见错误

平台errcode解决方案
企业微信301019图片 MD5 不匹配
企业微信93000webhook key 无效
钉钉40014access_token 无效
钉钉40035at_mobiles 格式错误
飞书99991663webhook URL 无效
飞书230001消息内容过长

注意事项

  1. 频率限制

    • 企业微信:每分钟 20 条
    • 钉钉:每分钟 20 条
    • 飞书:每分钟 100 条
  2. 内容限制

    • 钉钉 Markdown 支持有限标题、列表、链接等
    • 飞书卡片支持更丰富的交互
  3. 敏感词:各平台都会对内容进行过滤

Comments

Loading comments...