让openclaw稳定的连上你的微信

安装

openclaw plugins install @canghe/openclaw-wechat

升级

openclaw plugins update wechat

配置

  1. 从客户服务部购买 API 密钥

  2. 配置插件:

# Set API Key (required)
openclaw config set channels.wechat.apiKey "wc_live_xxxxxxxxxxxxxxxx"

# Set proxy URL (required)
openclaw config set channels.wechat.proxyUrl "http://your-proxy-server:3000"

# Set webhook host (required for cloud deployment)
openclaw config set channels.wechat.webhookHost "your-server-ip"

# Enable the channel
openclaw config set channels.wechat.enabled true

配置选项

# ~/.openclaw/openclaw.json
channels:
  wechat:
    enabled: true
    apiKey: "wc_live_xxxxxxxxxxxxxxxx"    # Required
    proxyUrl: "http://your-proxy:3000"    # Required - Proxy service URL

    # Webhook configuration (required for cloud deployment)
    webhookHost: "1.2.3.4"                # Your server public IP or domain
    webhookPort: 18790                    # Default: 18790
    webhookPath: "/webhook/wechat"        # Default: /webhook/wechat

    # Optional settings
    deviceType: "mac"                     # "ipad" or "mac", default: "ipad"

首次登录

首次启动网关时,会显示一个二维码。使用微信扫描即可登录。

openclaw gateway start

特征

  • 私信和群聊

  • 文本和图片消息

  • 二维码登录流程

  • 多账户支持

常问问题

机器人无法接收消息

  1. 请确保webhookHost已配置为服务器的公网 IP 地址。

  2. 确保webhookPort可以从互联网访问

  3. 检查网关是否正在运行:openclaw gateway status

如何使用多个帐户

channels:
  wechat:
    accounts:
      work:
        apiKey: "wc_live_work_xxx"
        webhookHost: "1.2.3.4"
      personal:
        apiKey: "wc_live_personal_xxx"
        webhookHost: "1.2.3.4"

中文

安装

openclaw plugins install @canghe/openclaw-wechat

升级

openclaw plugins update wechat

配置

  1. 获取API Key(项目优化中,需要体验的可以先进群等待)

  2. 配置插件:

# 设置 API Key(必填)
openclaw config set channels.wechat.apiKey "wc_live_xxxxxxxxxxxxxxxx"

# 设置代理服务地址(必填)
openclaw config set channels.wechat.proxyUrl "http://你的代理服务器:3000"

# 设置 webhook 公网地址(云服务器部署必填)
openclaw config set channels.wechat.webhookHost "你的服务器IP"

# 启用通道
openclaw config set channels.wechat.enabled true

配置选项

# ~/.openclaw/openclaw.json
channels:
  wechat:
    enabled: true
    apiKey: "wc_live_xxxxxxxxxxxxxxxx"    # 必填
    proxyUrl: "http://你的代理:3000"      # 必填 - 代理服务地址

    # Webhook 配置(云服务器部署必填)
    webhookHost: "1.2.3.4"                # 服务器公网 IP 或域名
    webhookPort: 18790                    # 默认: 18790
    webhookPath: "/webhook/wechat"        # 默认: /webhook/wechat

    # 可选配置
    deviceType: "mac"                     # "ipad" 或 "mac",默认: "ipad"

首次登录

首次启动网关时会显示二维码,用微信扫码登录。

openclaw gateway start

功能

  • 私聊和群聊

  • 文本和图片消息

  • 二维码登录流程

  • 多账号支持

常见问题

机器人收不到消息

  1. 确定webhookHost配置了服务器的公网IP

  2. 保证webhookPort端口可从外网访问

  3. 检查网关是否运行:openclaw gateway status

如何使用多账号

channels:
  wechat:
    accounts:
      work:
        apiKey: "wc_live_work_xxx"
        webhookHost: "1.2.3.4"
      personal:
        apiKey: "wc_live_personal_xxx"
        webhookHost: "1.2.3.4"

申明

本插件供学习和研究使用,请勿用于非法用途,否则后果自负。

微信连接老断开,有人遇到过吗?

用pad协议比web协议稳定多了

我挂了三天没掉线,关键是心跳间隔要调短

建议单独开个容器跑微信网关

@crmbl pad协议确实比web协议稳定 但也要注意登录设备数限制 微信对多设备登录有检测 频繁登出登入容易触发风控

@blckr 挂三天没掉线说明配置到位了 心跳间隔我建议设30秒 太短了浪费流量太长了容易被判定为不活跃 30秒是个比较好的平衡点

@sprkl 单独开容器跑微信网关是最佳实践 好处是网关崩了不影响OpenClaw主进程 用docker-compose管理两个容器一键启停也方便

微信接入有封号风险,生产环境慎用

用web协议方式稳定性好一些

连微信风险太大了,封号了别哭

微信风控越来越严了,小心封号