npm package: @icesword760/openclaw-wechat
Description: OpenClaw WeChat personal account channel plugin via WeChatPadPro (iPad protocol)
Latest version: 2026.2.24

# @icesword760/openclaw-wechat

OpenClaw channel plugin for **WeChat personal accounts** via [WeChatPadPro](https://github.com/WeChatPadPro/WeChatPadPro) (iPad protocol).

## Features

- Direct messages and group chats
- Keyword trigger prefix (e.g. `@ai`) to coexist with personal use
- AI reply prefix (e.g. `🤖`) for visual distinction
- Per-peer session routing for independent conversations
- Quote reply support (extracts referenced message context)
- Image and file exchange (inbound download + outbound send)
- QR code login flow with terminal display
- DM pairing / allowlist / open access policies
- Multi-account support

## Prerequisites

1. **WeChatPadPro** running and accessible (see [WeChatPadPro docs](https://github.com/WeChatPadPro/WeChatPadPro))
2. A **TOKEN_KEY** generated via the WeChatPadPro admin API
3. **OpenClaw** installed (`npm i -g openclaw`)

## Install

```bash
openclaw plugins install @icesword760/openclaw-wechat
```

## Configure

```bash
openclaw config set channels.wechat.enabled true
openclaw config set channels.wechat.serverUrl http://localhost:8849
openclaw config set channels.wechat.token YOUR_TOKEN_KEY
```

### Optional settings

```bash
# Only process messages starting with "@ai"
openclaw config set channels.wechat.triggerPrefix "@ai"

# Prefix AI replies with an emoji
openclaw config set channels.wechat.replyPrefix "🤖 "

# Independent conversation context per user
openclaw config set session.dmScope "per-peer"

# DM access policy: "pairing" (default), "allowlist", or "open"
openclaw config set channels.wechat.dmPolicy "pairing"
```

### Full config example

```json
{
  "channels": {
    "wechat": {
      "enabled": true,
      "serverUrl": "http://localhost:8849",
      "token": "YOUR_TOKEN_KEY",
      "triggerPrefix": "@ai",
      "replyPrefix": "🤖 ",
      "dmPolicy": "pairing",
      "debugMessages": false
    }
  },
  "session": {
    "dmScope": "per-peer"
  }
}
```

## Usage

1. Start the OpenClaw gateway:

```bash
openclaw gateway
```

2. Scan the QR code displayed in your terminal with WeChat.

3. If using `pairing` policy, approve senders:

```bash
openclaw pairing approve wechat <CODE>
```

4. Send messages starting with your trigger prefix (e.g. `@ai hello!`).

## File Exchange

The plugin supports bi-directional file exchange:

**Receiving files from users:**
- Images are injected into the AI's visual context (multimodal models can see them)
- Documents/files are downloaded locally and their paths are provided to the AI

**Sending files to users:**
- The AI uses `MEDIA:/path/to/file` in its reply
- Images (png/jpg/gif/webp) are sent as WeChat image messages
- Other files (PDF, Excel, zip, etc.) are uploaded to WeChat CDN and sent as file attachments

## Architecture

```
User (WeChat) <-> WeChatPadPro (iPad Protocol) <-> This Plugin <-> OpenClaw Agent
```

- **Inbound**: HTTP polling via `POST /message/HttpSyncMsg`
- **Outbound text**: `POST /message/SendTextMessage`
- **Outbound images**: `POST /message/SendImageNewMessage`
- **Outbound files**: `POST /message/UploadFileToCDN` + `POST /message/SendAppMessage`

## License

MIT