RCBridge 是一个 Windows 桌面桥接工具:通过 WeRC 接收微信消息,将其转发给 OneBot v11 应用,并把机器人的回复发回微信。它不自带机器人、模型或微信客户端。
| 项目 | 支持范围 |
|---|---|
| 桌面端 | Windows x64,需 Microsoft Edge WebView2 Runtime。便携包自带 Python 和桥接依赖,不包含微信、WeRC 或 AstrBot。 |
| 微信接入 | 推荐用 WeRC:接收原生入站消息,支持发送文本、图片、文件、视频和语音(取决于 WeRC 接受的格式和授权范围)。也可配置 Alpha 或 WeFlow 为接收源,或选择 Windows UIA 发送;这些是独立的接入路径,能力不完全相同。 |
| 机器人接入 | OneBot v11 反向 WebSocket:RCBridge 主动连接下游应用提供的地址。通用模式不依赖 AstrBot;配置 AstrBot 后可使用其成员权限同步和重启功能。 |
新版 WeRC 的「Bot 收发」令牌默认含群名同步、好友列表和分类通讯录。RCBridge 在后台刷新当前账号的名册;OneBot 群名和好友查询只读缓存。只读扩展 get_conversation_directory 也提供公众号名称,不将公众号混入好友列表。数据来自 WeRC 本地通讯录,不代表微信服务器的实时全量名单。
WeRC 发送模式下,OneBot image 段中的 GIF 会按内容识别并作为原生表情发送,需 WeRC 支持原生表情发送。JPG/PNG 仍作为普通图片发送。
OneBot reply 支持微信原生文字引用,需要 WeRC 的引用接口支持按接收位置(position)定位原消息。WeRC 群消息单独上报。群回复仅引用指定的原消息;发送前无法确认锚点时去掉引用,不猜测。
WeRC 私聊和群聊的入站引用按账号、会话和原消息 ID 精确匹配。匹配后通过标准 reply / get_msg 提供原文、已核实的发送者、公开卡片链接或可读取的媒体。缓存淘汰或重启后可从 WeRC 保留的原生记录回查;无法定位时只发当前正文,引用预览单独放在 rcbridge_quote_preview,不按昵称或同文猜测。
主动发送按当前账号的 WeRC 原生会话记录恢复目标,不按昵称匹配,也不重放旧消息。没有原生记录的会话无法确认;群作者只使用 WeRC 核验的身份,未知发送者用 user_id: 0。发送结果未知时不会自动重发。
- 从 Releases 下载 Windows x64 便携包。完整解压,运行顶层的
RCBridge.exe。 - 在已连接微信的 WeRC 中复制「Bot 接入」配置,在 RCBridge 的「设置」中导入,然后填写 OneBot v11 反向 WebSocket 地址及所需令牌。
- 保存后关闭并重新打开 RCBridge,点击「启动桥接」。在总览确认两端已连接,再用测试联系人验证实际收发。
「设置 → 启动与关闭」可分别开启 Windows 登录后启动 RCBridge 和 启动 RCBridge 后自动开启桥接。两项默认关闭;第一项仅适用于当前 Windows 用户。
在「设置 → 启动与关闭」选择点 × 后是最小化到托盘(默认)还是退出程序,保存后立即生效,不再弹窗。收进托盘时桥接继续运行,左键单击托盘图标可恢复,右键可直接退出。
RCBridge is a Windows desktop bridge. It receives WeChat messages through WeRC, forwards them to a OneBot v11 app, and sends the bot's replies back to WeChat. It does not provide a bot, model, or WeChat client.
| Area | Support |
|---|---|
| Desktop | Windows x64 with Microsoft Edge WebView2 Runtime. The portable package includes Python and bridge dependencies, but not WeChat, WeRC, or AstrBot. |
| WeRC is recommended for native inbound messages and sending text, images, files, video, and audio, subject to WeRC permissions and accepted formats. Alpha and WeFlow are alternative receive sources, and Windows UI Automation is an alternative send method. These paths have different capabilities. | |
| Bots | OneBot v11 over reverse WebSocket: RCBridge connects to the endpoint exposed by the downstream app. AstrBot is optional and enables additional member-permission sync and restart controls when configured. |
The newer WeRC Bot preset includes group-name sync, the friend list, and the categorized directory in one token. RCBridge refreshes the account directory in the background. get_group_list and get_friend_list read cached data; the read-only get_conversation_directory extension also exposes official accounts without adding them to the friend list. This reflects WeRC’s local directory, not live server relationships.
When sending via WeRC, RCBridge detects GIF bytes in OneBot image segments and sends them as native emoticons on supported WeRC builds. JPG/PNG still go through the regular image route.
OneBot reply supports native WeChat text quotes with a WeRC build that can resolve the original message by receive position. WeRC group messages are forwarded individually. Group replies quote only the exact source message; if the anchor cannot be verified before sending, the reply is sent without a quote.
For inbound WeRC quotes in private and group chats, RCBridge matches the account, conversation, and native message ID. A match produces a standard reply with the original text, verified sender, public card link, or available media via get_msg. After eviction or restart, lookup depends on retained native observations. On a miss, only the current body is sent as message text; the separate rcbridge_quote_preview field contains unverified context, not an author or reply ID.
Proactive sends resolve targets from the current account’s WeRC native observations, without matching display names or replaying old messages. Conversations without a matching native record cannot be resolved. Group senders are identified only by verified WeRC author IDs; OneBot reports an unknown sender as user_id: 0. Unconfirmed sends are not retried automatically.
- Download the Windows x64 portable ZIP from Releases. Extract the entire ZIP and run
RCBridge.exeat the top level. - In WeRC, connect WeChat and copy the bot connection settings. Import them in RCBridge's Settings, then enter the OneBot v11 reverse WebSocket URL and any required token.
- Save, close and reopen RCBridge, then start the bridge. Check that both connections are up and verify message delivery with a test contact.
Settings → Startup and close has separate options for opening RCBridge at Windows sign-in and starting the bridge when RCBridge opens. Both are off by default; sign-in startup applies to the current Windows user only.
Under Settings → Startup and close, choose whether × minimizes to the tray (default) or exits. The choice applies immediately without a prompt. The bridge keeps running in the tray; left-click its icon once to restore the window or right-click to exit.
Usage and troubleshooting (Chinese) · Changelog (Chinese) · License
在 Windows x64 上使用 64 位 CPython 3.13 和 .NET Framework 4.x 的 x64 C# 编译器。在项目根目录用 PowerShell 执行;输出目录须不存在。
On Windows x64, use 64-bit CPython 3.13 and the x64 .NET Framework 4.x C# compiler. Run in PowerShell from the repository root; the output directory must not already exist.
py -3.13 -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements-lock.txt
.\.venv\Scripts\python.exe -X utf8 -m unittest discover -s tests
.\.venv\Scripts\python.exe -X utf8 build_desktop.py build/RCBridge-win-x64
.\.venv\Scripts\python.exe -X utf8 tests/offline_roundtrip.py build/RCBridge-win-x64