Files
AgentsMeeting/gateway/linux
zhiwei 1417552990 fix: group chat detection + article URL handling (Xiaohongshu/WeChat/zhihu)
- 群聊检测: 通过 protocol 的 group_id 字段识别群消息
- 引用消息: 处理 ref_msg 中的转发文章/引用内容
- 文章URL: 支持 mp.weixin.qq.com / xiaohongshu.com / xhslink.com / zhihu.com
- CDN图片: 占位函数,后续实现 AES 解密下载
- 图片OCR: 统一失败处理,不再发送两条消息
2026-06-23 20:48:57 +08:00
..
2026-06-23 20:40:19 +08:00

MoWeChat — 莫荷微信 Bot (Linux iLink 版)

将莫荷的微信 bot 从 Windows wxhelper DLL 注入方案迁移到 Linux 原生运行的腾讯官方 iLink Bot API。

架构

微信 → iLink Bot API (ilinkai.weixin.qq.com) → wechat_agent.py → Hermes Gateway (:8642) → Agent
  • iLink Bot API: 腾讯 2026 年开放的官方微信个人号 Bot 接口
  • weixin-bot-sdk: Python SDK,处理 QR 登录、长轮询收消息、发消息
  • Hermes Gateway: 原有的 LLM 处理管道,无变动

快速开始

cd gateway/linux
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
python3 wechat_agent.py

首次运行会显示二维码,用莫荷的手机微信扫码登录。凭证保存在 ~/.weixin-bot/credentials.json,后续运行自动跳过扫码。

与 Windows 版的差异

功能 Windows (wxhelper) Linux (iLink)
消息收发 DLL 注入 → HTTP 官方 API → HTTP
QR 登录 降版本微信手动登录 终端二维码扫码
图片 OCR doubao API doubao API
文章处理 article_processor article_processor
图片生成 SenseNova SenseNova
联系人查询 wxhelper API iLink 不支持
历史记录查询 wxhelper SQL 改用 session_search
文件发送 wxhelper sendFile 发送下载链接
5801 端口 支持 支持

服务管理

systemd service:

sudo cp mohe-wechat.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable mohe-wechat
sudo systemctl start mohe-wechat

日志

日志文件:../../logs/wechat_agent_linux.log