Loading...
Loading...
Connect OpenClaw AI agents to personal WeChat accounts for messaging, group chats, and automation
npx skill4agent add aradotso/hermes-skills openclaw-wechat-integrationSkill by ara.so — Hermes Skills collection.
openclaw plugins install @canghe/openclaw-wechatopenclaw plugins update wechatopenclaw config set channels.wechat.apiKey "wc_live_xxxxxxxxxxxxxxxx"openclaw config set channels.wechat.proxyUrl "http://your-proxy-server:3000"openclaw config set channels.wechat.webhookHost "your-server-ip"openclaw config set channels.wechat.enabled true~/.openclaw/openclaw.json{
"channels": {
"wechat": {
"enabled": true,
"apiKey": "wc_live_xxxxxxxxxxxxxxxx",
"proxyUrl": "http://your-proxy:3000",
"webhookHost": "1.2.3.4",
"webhookPort": 18790,
"webhookPath": "/webhook/wechat",
"deviceType": "ipad"
}
}
}| Option | Required | Default | Description |
|---|---|---|---|
| Yes | | Enable/disable the WeChat channel |
| Yes | - | API key from service provider |
| Yes | - | Proxy service URL for WeChat protocol |
| Cloud only | - | Public IP or domain for webhooks |
| No | | Port for webhook listener |
| No | | Webhook endpoint path |
| No | | Device type: |
openclaw gateway startopenclaw gateway statusopenclaw gateway logs{
"channels": {
"wechat": {
"accounts": {
"work": {
"apiKey": "wc_live_work_xxx",
"webhookHost": "1.2.3.4",
"webhookPort": 18790,
"deviceType": "ipad"
},
"personal": {
"apiKey": "wc_live_personal_xxx",
"webhookHost": "1.2.3.4",
"webhookPort": 18791,
"deviceType": "mac"
}
}
}
}
}webhookPort// OpenClaw automatically handles incoming messages
// Configure message handlers in your OpenClaw skills
// Example skill handler (conceptual)
export async function onMessage(context: MessageContext) {
const { message, channel } = context;
if (channel === 'wechat') {
console.log('WeChat message:', message.text);
console.log('From:', message.sender);
console.log('Chat type:', message.isGroup ? 'group' : 'private');
}
}// Example: Sending a text message
await context.send({
channel: 'wechat',
to: 'wxid_xxxxxxxxxx',
text: 'Hello from OpenClaw!'
});
// Example: Sending to a group
await context.send({
channel: 'wechat',
to: 'group_id',
text: 'Message to group',
isGroup: true
});// Receiving images
export async function onMessage(context: MessageContext) {
if (context.message.type === 'image') {
const imageUrl = context.message.imageUrl;
// Process image
}
}
// Sending images
await context.send({
channel: 'wechat',
to: 'wxid_xxxxxxxxxx',
type: 'image',
imageUrl: 'https://example.com/image.png'
});# Example: UFW on Ubuntu
sudo ufw allow 18790/tcp# Test from external machine
curl http://YOUR_SERVER_IP:18790/webhook/wechat/etc/systemd/system/openclaw-gateway.service[Unit]
Description=OpenClaw Gateway Service
After=network.target
[Service]
Type=simple
User=YOUR_USER
WorkingDirectory=/home/YOUR_USER
ExecStart=/usr/local/bin/openclaw gateway start
Restart=on-failure
RestartSec=10
[Install]
WantedBy=multi-user.targetsudo systemctl enable openclaw-gateway
sudo systemctl start openclaw-gateway
sudo systemctl status openclaw-gatewayFROM node:18-alpine
WORKDIR /app
# Install OpenClaw
RUN npm install -g openclaw
# Install plugin
RUN openclaw plugins install @canghe/openclaw-wechat
# Expose webhook port
EXPOSE 18790
# Configure via environment
ENV OPENCLAW_CONFIG_PATH=/app/config/openclaw.json
CMD ["openclaw", "gateway", "start"]openclaw config get channels.wechat.webhookHost
# Should return your public IP# From external network
telnet YOUR_SERVER_IP 18790openclaw gateway statusopenclaw gateway logs --tail 100curl -X POST http://YOUR_SERVER_IP:18790/webhook/wechat \
-H "Content-Type: application/json" \
-d '{"test": true}'curl http://your-proxy-server:3000/healthopenclaw config get channels.wechat.apiKeyrm -rf ~/.openclaw/sessions/wechat
openclaw gateway restartopenclaw gateway restartwebhookPort{
"channels": {
"wechat": {
"accounts": {
"account1": {
"webhookPort": 18790
},
"account2": {
"webhookPort": 18791
}
}
}
}
}curl http://your-proxy-server:3000ping your-proxy-serveropenclaw config set channels.wechat.proxyUrl "http://new-proxy:3000"# View current configuration
openclaw config list
# Start gateway in foreground
openclaw gateway start
# Start gateway in background
openclaw gateway start --daemon
# Stop gateway
openclaw gateway stop
# Restart gateway
openclaw gateway restart
# View logs
openclaw gateway logs
# View real-time logs
openclaw gateway logs --follow
# Check gateway status
openclaw gateway status
# Uninstall plugin
openclaw plugins uninstall wechatexport WECHAT_API_KEY="wc_live_xxxxxxxxxxxxxxxx"
openclaw config set channels.wechat.apiKey "$WECHAT_API_KEY"openclaw config set logging.rotation.enabled true
openclaw config set logging.rotation.maxSize "100M"tar -czf openclaw-backup-$(date +%Y%m%d).tar.gz ~/.openclaw/sessionssudo ufw default deny incoming
sudo ufw allow 18790/tcp
sudo ufw enable