richagain

WeChat Work OpenClaw Adapter

商業營運v1.0.0
作者:richagain更新於 2026-05-11wecom-openclaw@clawhub_richagain/wecom-openclaw
客服助手#WeChat

據 AlphaMoat 統計,截至 2026-09,WeChat Work OpenClaw Adapter 累計下載 1,446 次、獲 0 個星標,在全部 5,078 個 AI 技能中排名第 4,802 位,在「商業營運」分類(297 個)中排名第 276 位。

累計安裝
219
累計下載
1446
星標
-
全站排名
#4,802
全站前 95% · 「商業營運」前 93%
平台累計安裝累計下載星標評論
ClawHub ↗401324--
SkillHub ↗2191446-—

各平台的計數口徑不同,統計時間不一致。

這個技能是做什麼的

Node.js 介接器驗證 msg_signature、解密訊息,再非同步呼叫 OpenClaw 和企業微信傳送介面。回呼須在 5 秒內回應,AI 回覆另行傳送。生產使用前需完成企業驗證,並把伺服器公網 IP 加入應用可信 IP 清單。

資料釋出於 2026-10-26

可以用來做什麼

  • 為企業微信應用設定雙向 AI 訊息通道

什麼時候用

  • 需要接收企業微信回呼並回傳非同步回覆時

示例提示詞

以下是根據技能文件生成的示例,不代表實際執行結果。

說明這個企業微信介接器的回呼、鑑權和非同步回覆設定

使用條件

依據技能文件中的宣告整理,未經實際安裝或執行驗證。

鑑權說明
需企業微信應用及回呼認證資料和 OpenClaw 閘道器設定;APP_SECRET 與 AGENT_SECRET / EncodingAESKey 用途不同。
配置要求
  • 需要公開 HTTPS 回呼;臨時 Cloudflare Tunnel 重啟會換地址且可能斷線,生產應採用穩定入口。

月度資料趨勢

累計下載1446
487100215172026-03 · 累計下載 5582026-05 · 累計下載 9682026-07 · 累計下載 12062026-08 · 累計下載 12682026-09 · 累計下載 144626-0326-09
星標-
0112026-03 · 星標 -2026-05 · 星標 -2026-07 · 星標 -2026-08 · 星標 -2026-09 · 星標 -26-0326-09

2026-09 起統計方法調整:同名技能按作者分別統計,並覆蓋全部技能。圖中虛線為調整前的月份,與之後的資料不直接比較,也不計算跨越調整的增長。

月份累計下載環比星標
2026-091446—-
2026-081268+5.1%-
2026-071206—-
2026-05968—-
2026-03558—-

SKILL.md 原文

以下是作者釋出的原始檔案,按純文字顯示,本站未做修改或稽核;其中的連結不可點選,命令請核實後再執行。抓取於 2026-10-23。

5.1 KB · ClawHub v1.0.0
---
name: wecom-openclaw
description: Integrate WeChat Work (Enterprise WeChat) with OpenClaw for intelligent messaging. Enables receiving messages from WeChat Work, processing them with Claude AI, and sending async replies. Handles msg_signature verification, AES-256-CBC encryption/decryption, and secure token-based authentication. Use when setting up bidirectional WeChat Work ↔ OpenClaw communication.
---

# WeChat Work → OpenClaw Adapter

## Quick Start

```bash
展開全部(共 124 行)
# 1. Deploy
bash <skill_dir>/scripts/deploy.sh

# 2. Edit .env with your WeChat Work credentials
nano ~/wecom-adapter/.env

# 3. Start
cd ~/wecom-adapter && npm start

# 4. Expose publicly
cloudflared tunnel --url http://localhost:8090

# 5. Copy tunnel URL → WeChat Work admin → webhook URL
```

## Architecture

```
WeChat Work → HTTPS → Cloudflare Tunnel → Node.js Adapter (8090)
                                              ├─ Verify msg_signature (SHA1)
                                              ├─ Decrypt message (AES-256-CBC)
                                              ├─ Return "success" within 5s
                                              └─ Async: call OpenClaw → send reply via WeCom API
```

**Key**: Adapter returns `success` immediately, then sends AI reply asynchronously via WeChat Work's `message/send` API. This avoids the 5-second timeout.

## ⚠️ Critical Gotchas (Learned the Hard Way)

### 1. Parameter name is `msg_signature`, NOT `signature`

WeChat Work sends `?msg_signature=xxx`, not `?signature=xxx`. Reading `req.query.signature` will always be `undefined`.

### 2. Signature must include echostr/encrypt

**GET verification**: `SHA1(sort([token, timestamp, nonce, echostr]))`
**POST messages**: `SHA1(sort([token, timestamp, nonce, encrypt]))`

NOT `SHA1(sort([token, timestamp, nonce]))` — the encrypted payload MUST participate in the signature.

### 3. echostr must be DECRYPTED before returning

WeChat Work sends an AES-encrypted echostr. You must:
1. Verify msg_signature
2. AES-256-CBC decrypt the echostr
3. Strip PKCS#7 padding
4. Extract message from format: `16-byte random + 4-byte length (BE) + message + CorpID`
5. Return the **decrypted message** (not the raw echostr)

### 4. APP_SECRET ≠ EncodingAESKey

- **APP_SECRET** (应用密钥): Used to get `access_token` for sending messages
- **AGENT_SECRET / EncodingAESKey**: Used for AES encryption/decryption
- These are TWO DIFFERENT keys from the WeChat Work console

### 5. Express body parser must accept multiple Content-Types

WeChat Work may send XML as `text/xml`, `application/xml`, or other types:
```javascript
app.use(express.text({ type: ['application/xml', 'text/xml', 'text/plain', '*/*'] }));
```

### 6. Async reply pattern is mandatory

WeChat Work requires response within 5 seconds. AI responses take 5-30s. Solution:
1. Return `res.status(200).send('success')` immediately
2. Call OpenClaw asynchronously
3. Send reply via `POST /cgi-bin/message/send?access_token=xxx`

### 7. IP whitelist required for sending messages

WeChat Work API (`qyapi.weixin.qq.com`) requires your server's public IP in the app's trusted IP list. Error `60020` means IP not whitelisted.

### 8. Enterprise verification required

⚠️ **Unverified enterprises risk account suspension.** WeChat may ban accounts that use API automation without proper enterprise verification. Complete verification before production use.

### 9. Cloudflare quick tunnels are unstable

Quick (account-less) tunnels generate new URLs on restart and may disconnect unexpectedly. For production, use Named Tunnels ($7/mo) or a static IP.

## Environment Variables

```env
CORP_ID=ww...              # From WeChat Work admin
AGENT_ID=1000003           # Application agent ID
AGENT_SECRET=xxx           # EncodingAESKey (43-char Base64, for encryption)
APP_SECRET=xxx             # Application Secret (for access_token)
WEBHOOK_TOKEN=xxx          # Token configured in webhook settings
OPENCLAW_TOKEN=xxx         # OpenClaw gateway bearer token
OPENCLAW_BASE_URL=http://localhost:18789  # OpenClaw gateway URL
CLAUDE_MODEL=claude-haiku-4-5             # AI model
```

## Files

- `scripts/deploy.sh` — One-command deployment
- `scripts/index.js` — Production-ready adapter (all fixes applied)
- `references/setup-guide.md` — Step-by-step WeChat Work configuration
- `references/security-guide.md` — Security architecture and hardening

## Troubleshooting

| Symptom | Cause | Fix |
|---------|-------|-----|
| `signature=undefined` | Using `req.query.signature` | Use `req.query.msg_signature` |
| Signature mismatch | echostr/encrypt not in calculation | Include 4th element in sort array |
| `-30065` error | Returning encrypted echostr | Decrypt before returning |
| `bad decrypt` | Wrong key or `setAutoPadding(true)` | Use `setAutoPadding(false)` + manual PKCS#7 |
| `body长度=undefined` | Body parser doesn't match Content-Type | Accept `*/*` in express.text() |
| `60020` IP error | Server IP not whitelisted | Add public IP in WeChat Work console |
| Timeout | 5s limit exceeded | Use async pattern: return success, send via API |
| Account banned | Unverified + automated messages | Verify enterprise first |

「商業營運」分類下的熱門技能

PollyReach商業營運

PollyReach gives every AI agent a phone number and the ability to get things done over the phone — finding contacts, making calls, and completing tasks. Just...

↓ 10.2萬★ 56PollyReach
Trello商業營運

透過 Trello REST API 管理看板、列表與卡片。

↓ 5.3萬★ 165Peter Steinberger
招標中標查詢及分析服務商業營運

全網招中標資料查詢與分析助手。當用戶涉及以下任何場景時,必須使用此SKILL:查詢招標/中標公告、搜尋標訊、查詢臨期/即將到期專案、查詢擬建專案與立項審批階段的早期商機、追蹤某個專案各階段進展與全流程時間線、商機預測、推薦潛在投標供應商、查詢企業工商登記資訊(統一社會信用程式碼/註冊資本/法定代表人/經營範圍/成立日期/登記機關/曾用名)、分析公司主營業務/歷史中標、查詢公司上下游合作客戶與供應商、分析競爭對手/競對企業、查詢Top採購單位/Top中標單位/Top中標品牌、招中標資料統計分析(按月/季/年/省份/品牌等維度)、查詢品牌型號歷史中標單價/價格趨勢、查詢當前帳戶餘額/剩餘積分/累計充值消費、市場分析/行業分析/採購尋源/渠道拓展等採購與投標相關場景。即使使用者沒有提到「知了標訊」,只要涉及招投標、採購、中標、供應商、競爭對手、企業工商資訊、帳戶餘額、剩餘積分等關鍵詞,都應使用本SKILL。

↓ 4.6萬★ 13user_98035bfb
產品經理綜合技能(PM Master)商業營運

需求分析、PRD編寫、產品需求文件、詳細設計、BRD、MRD、PRD模板、使用者故事、使用者訪談、需求挖掘、痛點分析、功能設計、KANO模型、Y模型、5W1H、優先順序排序、需求池管理、寫過需求、寫PRD、做需求分析、產品設計、產品策略、SWOT分析、波特五力、PESTLE、安索夫矩陣、商業模式畫布、價值主張、產品願景、OKR制定、Sprint規劃、回顧會、釋出說明、干係人管理、競品分析、市場調研、使用者研究、機會解決方案樹、指標看板、測試場景、頭腦風暴、假設驗證

↓ 3.4萬★ 343user_dec48685
Calendar商業營運

面向日曆管理與會議排期的技能。

↓ 2.7萬★ 9NDCCCCCC
Market Analysis CN | 市場分析服務商業營運

提供市場趨勢、競品與使用者行為分析的市場分析服務。

↓ 2.7萬★ 32Guohongbin
電商選品商業營運

電商平台爆款產品篩選分析 - 基於資料分析的智慧選品工具,支援淘寶、京東、拼多多、抖音、亞馬遜等平台

↓ 2.6萬★ 77user_c2b88a14
Salesforce商業營運

透過託管 OAuth 與 Salesforce CRM API 整合。僅在需要 Salesforce CRM 管理時才安裝。使用最小許可權連線 Salesforce,破壞性或批次操作首選沙箱組織,每次請求前驗證目標連線 ID,並撤銷未使用的連線。

↓ 2.5萬★ 8byungkyu

資料月份:2026-09 · 下載/星標/安裝數聚合自公開技能註冊庫(ClawHub、SkillHub),按月更新。口徑說明見資料方法。