wecom-app

reece15/wecom-bot

Otheropenclawby reece15

Summary

OpenClaw plugin exposing 0 skills across wecom-app.

Install to Claude Code

openclaw plugin add reece15/wecom-bot

Run in Claude Code. Add the marketplace first with /plugin marketplace add reece15/wecom-bot if you haven't already.

README.md

OpenClaw 企业微信 (WeCom) 插件

English | 中文

这是一个 OpenClaw 的独立插件,为您的 AI 助手添加 企业微信 (WeCom) 渠道支持。它允许您将 OpenClaw 强大的 AI 智能体能力接入到企业微信应用中。你可以配置微信收发企业微信消息,来通过微信客户端与openclaw进行交互。

功能特性

  • 微信收发消息:支持企业微信用户与 AI 智能体的消息交互。
  • 企业微信 Webhook 集成:通过回调接收企业微信消息。
  • 企业验证:支持 CorpID、Secret、AgentID 以及 Token/AES Key 验证。
  • AI 智能体能力:将企业微信用户连接到 OpenClaw 的 AI 智能体。
  • 消息发送:支持向企业微信用户发送回复消息。
  • 向导支持:集成 OpenClaw 的 onboarding 向导,配置更简单。

安装

在插件目录下执行:

git clone https://github.com/openclaw/wecom-bot.git && cd wecom-bot
openclaw plugins install . 
# 或者使用 npx: npx openclaw plugins install .

> 注意:安装过程可能需要下载依赖,请耐心等待。

配置

1. 获取企业微信凭证

1. 登录 企业微信管理后台。 2. 进入 我的企业 -> 企业信息,获取 CorpID。 3. 进入 应用管理 -> 创建应用(或选择现有应用)。 4. 获取应用的 AgentIdSecret。 5. 在应用详情页 -> 接收消息 -> 设置 API 接收

  • 获取 TokenEncodingAESKey
  • URL 需要填入 OpenClaw 网关的公网地址,格式通常为 http://YOUR_SERVER_IP:PORT/wecom-app/webhook

6. 配置可信Ip: 将openclaw的ip添加到可信ip列表中。

2. 添加配置

方式一:交互式配置 (推荐)

openclaw onboard
# 选择 wecom-app 进行交互式配置

方式二:命令行配置

openclaw channels add --channel wecom-app

方式三:手动编辑配置

编辑您的 OpenClaw 配置文件(通常位于 ~/.openclaw/openclaw.json):

{
  "channels": {
    "wecom-app": {
      "default": {
        "enabled": true,
        "corpid": "ww...",
        "corpsecret": "...",
        "agentid": "1000001",
        "token": "...",
        "encodingAESKey": "..."
      }
    }
  }
}

配置项说明

| 配置项 | 必填 | 说明 | |--------|------|------| | corpid | 是 | 企业 ID (CorpID) | | corpsecret | 是 | 应用 Secret | | agentid | 是 | 应用 AgentID | | token | 否 | Webhook 回调 Token (接收消息必填) | | encodingAESKey | 否 | Webhook 加密 Key (接收消息必填) |

使用

启动

后台启动网关:

openclaw gateway restart

前台启动(方便查看日志):

openclaw gateway --verbose

如何微信收发企业微信消息

!alt text 点击链接查看和 Kimi 的对话 https://www.kimi.com/share/19c4c4a9-c0f2-8b4b-8000-0000359762b6

常见问题与排查

1. 无法发送消息 / Error 60020

现象

  • 用户发送消息后,后台日志显示接收正常。
  • 机器人回复失败,日志报错 Error: WeCom API error 60020: not allow to access from your ip

原因: 服务器 IP 未被添加到企业微信应用的“企业可信 IP”白名单中。即使配置了接收消息的回调,发送消息(调用 API)仍需校验 IP 白名单。

解决方案: 1. 登录 企业微信管理后台。 2. 进入 应用管理 -> 选择您的应用(Agent)。 3. 找到 企业可信IP 配置项,点击“配置”。 4. 将您的服务器公网 IP 添加到列表中并保存。

2. 无法接收消息

排查步骤: 1. 检查 openclaw gateway 是否正常启动并监听端口。 2. 检查企业微信后台“接收消息”配置中的 URL 是否正确,能否通过公网访问。 3. 确保 TokenEncodingAESKey 配置与后台一致。

升级

cd wecom-bot
git pull
npm install
npm run build
openclaw plugins install . --force
openclaw gateway restart

License

MIT

Related plugins

Browse all →