--- name: l1-webhook-push description: "L1 原子技能:消息推送。向飞书、Slack、Discord、钉钉或任意 Webhook URL 发送通知消息。" layer: 1 domain: delivery keywords: - webhook - notify - feishu - slack - message - push - alert input_schema: "{ target: string, message: string, webhook_url?: string }" output_schema: "{ success: boolean, status: number }" --- # L1: Webhook Push(消息推送原子技能) ## 能力 向各类即时通讯平台或自定义 Webhook 发送通知消息。 ## 使用方法 ### 飞书机器人 ```bash curl -s -X POST "" \ -H "Content-Type: application/json" \ -d '{ "msg_type": "text", "content": {"text": "通知内容"} }' ``` ### 飞书富文本消息 ```bash curl -s -X POST "" \ -H "Content-Type: application/json" \ -d '{ "msg_type": "interactive", "card": { "header": {"title": {"tag": "plain_text", "content": "标题"}}, "elements": [{"tag": "markdown", "content": "**内容**"}] } }' ``` ### Slack ```bash curl -s -X POST "" \ -H "Content-Type: application/json" \ -d '{"text": "通知内容"}' ``` ### Discord ```bash curl -s -X POST "" \ -H "Content-Type: application/json" \ -d '{"content": "通知内容"}' ``` ### 钉钉机器人 ```bash curl -s -X POST "" \ -H "Content-Type: application/json" \ -d '{ "msgtype": "text", "text": {"content": "通知内容"} }' ``` ### 通用 Webhook(任意 URL) ```bash curl -s -X POST "" \ -H "Content-Type: application/json" \ -d '{"event": "notification", "message": "通知内容"}' ``` ## 输入 | 参数 | 类型 | 必填 | 说明 | |------|------|------|------| | target | string | ✅ | 平台: `feishu` / `slack` / `discord` / `dingtalk` / `custom` | | message | string | ✅ | 消息内容(支持 Markdown) | | webhook_url | string | ❌ | Webhook URL(从环境变量读取或直接指定) | ## 输出 | 字段 | 说明 | |------|------| | success | 是否发送成功 | | status | HTTP 状态码 | ## 环境变量 | 变量 | 平台 | |------|------| | `FEISHU_WEBHOOK_URL` | 飞书 | | `SLACK_WEBHOOK_URL` | Slack | | `DISCORD_WEBHOOK_URL` | Discord | | `DINGTALK_WEBHOOK_URL` | 钉钉 | ## 约束 - 消息长度限制:4000 字符 - 如果未设置 webhook_url 且环境变量未配置,返回错误提示