Files
AgentsMeeting/gateway/linux
zhiwei 7727e907e6 feat: 莫荷微信Bot Linux iLink版
新增 gateway/linux/ 目录,基于腾讯官方 iLink Bot API 的 Linux 原生实现。
替代 Windows wxhelper DLL 注入方案。

- wechat_agent.py: 核心 Agent (消息处理/OCR/文章处理/图片生成/5801服务)
- requirements.txt: weixin-bot-sdk + aiohttp + requests
- mohe-wechat.service: systemd 服务单元
- .env.example: 配置模板
- README.md: 使用说明

工作原理: iLink Bot API (ilinkai.weixin.qq.com)
  → QR扫码登录 → 长轮询收消息 → Hermes Gateway(:8642) 处理 → 回复
2026-06-23 20:40:19 +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