尧图网站建设 尧图网络
  • 首页
  • 关于我们
  • 服务项目
  • 案例展示
  • 建站流程
  • 资讯中心
  • 联系我们
首页/资讯中心/详情

Hermes 配置微信

Hermes 配置微信
📅 发布时间:2026/7/23 23:46:42

环境

Win11,WSL2,Ubuntu24.04

一、相关文档

Weixin (微信)

Weixin (WeChat)

二、前置安装

pip install aiohttp cryptography # Optional: for terminal QR code display pip install hermes-agent[messaging]

pip install aiohttp cryptography 安装

uadmin@UD26:~$ pip install aiohttp cryptography Command 'pip' not found, but can be installed with: sudo apt install python3-pip uadmin@UD26:~$ sudo apt update uadmin@UD26:~$ sudo apt install python3-pip uadmin@UD26:~$ pip3 install aiohttp cryptography error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try apt install python3-xyz, where xyz is the package you are trying to install. If you wish to install a non-Debian-packaged Python package, create a virtual environment using python3 -m venv path/to/venv. Then use path/to/venv/bin/python and path/to/venv/bin/pip. Make sure you have python3-full installed. If you wish to install a non-Debian packaged Python application, it may be easiest to use pipx install xyz, which will manage a virtual environment for you. Make sure you have pipx installed. See /usr/share/doc/python3.12/README.venv for more information. note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages. hint: See PEP 668 for the detailed specification. 安装报错,安装这个简单,版本可能旧一点 uadmin@UD26:~$ sudo apt install python3-aiohttp python3-cryptography

使用hermes的虚拟环境安装

uadmin@UD26:~$ source ~/.hermes/hermes-agent/venv/bin/activate

(venv) uadmin@UD26:~$ pip show aiohttp cryptography(先查一下,可能已经安装了)

(venv) uadmin@UD26:~$ pip install aiohttp cryptography

(venv) uadmin@UD26:~$ pip show aiohttp cryptography

其他venv相关用法

# 安装venv所需的程序包 sudo apt update && sudo apt install python3-full python3-venv -y # 查看安装情况 dpkg -l | grep python3-venv apt list --installed | grep python3-venv # 新建虚拟环境 python3 -m venv ~/venvs/hermes # 激活虚拟环境 source ~/venvs/hermes/bin/activate pip安装(在虚拟环境下) # 取消激活虚拟环境 deactivate # 删除虚拟环境 rm -rf ~/venvs/hermes

pip install hermes-agent[messaging]

安装报错,可以忽略,可以不安装。

也可以在venv中安装。

三、安装配置微信

gateway配置

hermes gateway setup

Select a platform to configure:
↑↓ navigate ENTER/SPACE select ESC cancel

(○) 💬 Mattermost (not configured)
(○) 📡 Signal (not configured)
(○) 💬 Weixin / WeChat (not configured)
(○) 💬 BlueBubbles (iMessage) (not configured)
(○) 🐧 QQ Bot (not configured)
(○) 💎 Yuanbao (not configured)
(○) 🐳 DingTalk (not configured)
(○) 🎮 Discord (not configured)
(○) 📧 Email (not configured)
(○) 🪽 Feishu / Lark (not configured)
(○) 💬 Google Chat (not configured)
(○) 🏠 Home Assistant (not configured)
(○) 💬 IRC (not configured)
(○) 💚 LINE (not configured)
(○) 🔐 Matrix (not configured)
(○) 🔔 ntfy (not configured)
(○) 📱 iMessage via Photon (not configured)
(○) 🔔 Raft (not configured)
(○) 🔒 SimpleX Chat (not configured)
(○) 💼 Slack (not configured)
(○) 📱 SMS (Twilio) (not configured)
(○) 💼 Microsoft Teams (not configured)
(○) ✈️ Telegram (not configured)
(○) 💼 WeCom (Enterprise WeChat) (not configured)
(○) 💼 WeCom Callback (self-built apps) (not configured)
(○) 💬 WhatsApp (not configured)
→ (●) Done

选择
→ (○) 💬 Weixin / WeChat (not configured)

使用微信扫码

私信消息授权

How should direct messages be authorized?
↑↓ navigate ENTER/SPACE select ESC cancel

→ (●) Use DM pairing approval (recommended)
(○) Allow all direct messages
(○) Only allow listed user IDs
(○) Disable direct messages

默认

处理群聊

How should group chats be handled?
↑↓ navigate ENTER/SPACE select ESC cancel

→ (●)Disable group chats (recommended)
(○) Allow all group chats
(○) Only allow listed group chat IDs

选择
→ (○) Only allow listed group chat IDs

微信群聊ID不好获取,建议选默认的选项

日志输出:

.
微信连接成功,account_id=6e1234567890@im.bot

Skipped (keeping current)

✓ DM pairing enabled.
Unknown DM users can request access and you approve them with `hermes pairing approve`.

Note: QR login connects an iLink bot identity (e.g. ...@im.bot), not a
scriptable personal WeChat account. Ordinary WeChat groups typically cannot
invite an @im.bot identity, and iLink does not deliver ordinary-group events
to most bot accounts. The settings below only apply when iLink actually
delivers group events for your account type — otherwise DM remains the only
working channel regardless of this choice.

Allowed group chat IDs (comma-separated, not member user IDs):(回车先不填)
✓ Group allowlist saved (only takes effect if iLink delivers group events).

设置主聊天

后续可以在聊天窗口,输入/sethome设置。

Use your Weixin user ID (o9cq807bOHexabcde_abcdefghij@im.wechat) as the home channel? [Y/n]: Y
✓ Home channel set to o9cq807bOHexabcde_abcdefghij@im.wechat

✓ Weixin configured!
Account ID: 6e1234567890@im.bot
User ID: o9cq807bOHexabcde_abcdefghij@im.wechat

选择Done

Select a platform to configure:
→ (●) Done

◆ Messaging Platforms
Skipped (keeping current)

重启gateway

────────────────────────────────────────────────────────── Restart the gateway to pick up changes? [Y/n]: Y
⏳ User service restarting gracefully (PID 2153)...
⚠ Graceful restart did not complete within 5s; forcing a service restart...
⏳ User service process started (PID 7594); waiting for gateway runtime...
✓ User service restarted (PID 7594)

四、配置文件

.env

~/.hermes/.env

WEIXIN_ACCOUNT_ID=6e1234567890@im.bot WEIXIN_TOKEN=6e1234567890@im.bot:060000bb1502d9f74dea7d8d4cbb1234567890 WEIXIN_BASE_URL=https://ilinkai.weixin.qq.com WEIXIN_CDN_BASE_URL=https://novac2c.cdn.weixin.qq.com/c2c WEIXIN_DM_POLICY=pairing WEIXIN_ALLOW_ALL_USERS=false WEIXIN_ALLOWED_USERS= WEIXIN_GROUP_POLICY=allowlist WEIXIN_GROUP_ALLOWED_USERS= WEIXIN_HOME_CHANNEL=o9cq807bOHexabcde_abcdefghij@im.wechat

如果How should group chats be handled?

想选择Disable group chats (recommended),

可以修改

WEIXIN_GROUP_POLICY=disabled
# 下面这一行直接删掉或者留空都可以
# WEIXIN_GROUP_ALLOWED_USERS=

重启网关
hermes gateway restart

config.yaml

~/.hermes/config.yaml

platforms: weixin: enabled: false feishu: enabled: true

这里的weixin:enabled: false,没什么影响,后续可以手动改成true。

五、使用测试

修改备注

修改微信机器人的名称从微信ClawBot改为hermes助手

聊天配对

在hermes命令行输入批准配对命令

uadmin@UD26:~$ hermes pairing approve weixin A1B2C3D4 Approved! User o9cq807bOHexabcde_abcdefghij@im.wechat (o9cq807bOHexabcde_abcdefghij@im.wechat) on weixin can now use the bot~ They'll be recognized automatically on their next message.

聊天成功回复

设置主聊天

更多命令

相关新闻

  • 单向循环链表删除指定位置(第k个结点)结点,成功返回true,失败返回false
  • 【现货直发】HB3合金/N10675哈氏合金:镍基合金现货仓库批发商的专业实践 - 品牌深度评测
  • AI意图预测技术解析与应用实践

最新新闻

  • 神经网络架构搜索与多智能体强化学习工业应用解析
  • Django毕设项目: 基于 Django 的轻量化社区智能治理可视化系统 社区资源运维与数据统计可视化平台(源码+文档,讲解、调试运行,定制等)
  • vscode-clang-tidy
  • 知识城全屋定制哪家靠谱:派福装饰行业王牌 - MXyuyu
  • 2026年在手机上制作证件照:小程序、电脑工具和一版通用的方法 - 办公小帮手
  • 手机拍照搞定证件照,三种底色、几十种尺寸用这几个工具就够 - 办公小帮手

日新闻

  • 武汉卡地亚LOVE钻戒与钻石项链回收变现攻略|多家门店行情参考 - 大牌深度测评
  • 2026年无锡地区健康管理如何考量?四家机构业务体系概览
  • 2026图片去水印软件哪个好用 手机电脑免费工具盘点 - 免费软件工具方法教程

周新闻

  • SaaS软件行业GEO实践:AI搜索时代的品牌可见性与获客新路径
  • 什么是PCTFE?医药高端包装的“防潮王牌“材料
  • 【JVM调优实战】16-可视化利器-JConsole-VisualVM-JMC

月新闻

  • 2026年6月公司网站搭建最新热门渠道测评:四大低成本/零代码平台对比+避坑
  • 【Linux】Linux arm 编译QT程序,出现expected “}“报错
  • 【MATLAB例程】四基站二维AOA定位与距离辅助增强对比仿真。基于角度观测和测距修正的固定目标平面定位精度分析

关于尧图

  • 公司简介
  • 团队介绍
  • 企业文化
  • 荣誉资质

服务项目

  • 定制开发
  • 电商建站
  • UI 设计
  • 运维服务

快速链接

  • 案例展示
  • 建站流程
  • 常见问题
  • 资讯中心

联系方式

  • 📍北京市朝阳区互联网产业园 A 座 10 层
  • 📞400-888-8888
  • ✉️contact@rkmt.cn
  • 🕐周一至周日 9:00-21:00

© 2024 北京尧图网络科技有限公司 版权所有 | 京 ICP 备 XXXXXXXX 号