Connect Muse to a QQ-bot and let the bot in QQ become Muse itself: talk to the bot on QQ, and the reply is written on the spot by Muse according to its own persona, then sent back to QQ as-is. No other model is involved in between.
- daemon.py: the heart of the whole bridge, responsible for staying connected to the QQ server, receiving messages, and sending replies. It first stores messages from QQ, and once Muse has written a reply, it sends it back.
- Two hook scripts: one checks every 5 seconds for new messages and wakes Muse up to reply if there are any; the other checks every 30 seconds whether the bridge is still alive, and restarts it if it's dead.
- aiohttp handshake patch + self-healing guard: a header returned by the QQ server during the handshake gets mistakenly killed by the program, which makes it impossible to connect. This patch fixes that, and it won't be lost on reinstall—it's automatically restored at startup.
- qq-bridge.service: lets the system manage the bridge, so it can start on boot and recover from disconnects automatically without manual babysitting.
- qr-connect: a tool for scan-code binding. One scan connects the bot to this bridge. Note that the QR code expires in 3 minutes, so don't just send the code—send the authorization link directly; it's faster to open and click.
- Test: a self-check that runs without internet or an account. If all 14 items pass, the package isn't broken.
- Credentials template: just fill in AppID and AppSecret accordingly. Once filled in, set the file permissions so only you can read it.
A few honest things you should know
- QQ only gives you 5 minutes: if someone sends a message and you don't reply within 5 minutes, that message can no longer be replied to. So don't rush Muse when it's slow—it's thinking and writing on the spot.
- Replies are inherently slow: plain text usually takes 37 to 98 seconds, images 1 to 3 minutes. The slowness comes from having to spin up a Muse to think for every sentence—it's not the network's fault.
- The bridge will drop: when the container is recycled, the bridge gets killed. That's not the program being broken; that's just how the environment is. The watchdog will bring it back on the next check, usually within tens of seconds, but if the machine is down for a few hours, there's nothing that can be done.
- It can't see the original image: QQ images are stored on its own CDN, and the server side can't fetch them. Muse can only use a browser to look at the image and then reply, so image replies are even slower.
Disclaimer
- Use separate alt accounts for the QQ bot account and the connected account. Don't put the bridge on your main account—if the account gets banned or credentials leak, only the alt is affected.
- Bot behavior is still subject to platform rules. Mass messaging, frequent proactive messages, and violating content may trigger rate limits or bans.
- For personal learning and self-use only. Environment limitations like container recycling and downtime can't be fixed. The bridge may drop or lose messages at any time, so it's not suitable for important notifications or critical business.
Muse接入QQ-bot,让 QQ 里的机器人变成 Muse 本人:在 QQ 上跟机器人说话,回答是 Muse 按自己的人设现写的,再原样发回 QQ。中间不经过任何别的模型。
- daemon.py:整套桥的心脏,负责跟 QQ 服务器连着、收消息、发回复。QQ 发来的消息它先存下来,等 Muse 写好回复,它再发回去。
- 两个 hook 脚本:一个每 5 秒看一眼有没有新消息,有就叫 Muse 起来回;另一个每 30 秒检查桥还活着没,死了就把它拉起来。
- aiohttp 握手补丁 + 自愈守卫:QQ 服务器握手时回的一个头会被程序误杀导致连不上,这个补丁就是修这个的,而且重装也不会丢,启动时自动补回来。
- qq-bridge.service:让系统接管这个桥,开机、掉线都能自己起来,不用手动守着。
- qr-connect:扫码绑定的工具,扫一下就能把机器人和这套桥连上。注意二维码 3 分钟就过期,别只发码,直接发授权链接点开更快。
- 测试:不用联网、不用账号就能跑的自检,14 项全过说明包没坏。
- 凭据模板:照着填 AppID 和 AppSecret 就行,填好那个文件权限要设成只有自己能看。
几个要知道的实话
- QQ 只给 5 分钟:别人发消息过来,5 分钟内没回上,这条就回不了了。所以 Muse 回得慢的时候别催,它是现想现写。
- 回复本来就慢:纯文字一般 37 到 98 秒,图片 1 到 3 分钟,慢在每句话都要现起一个 Muse 来想,不怪网。
- 桥会掉线:容器一回收就把桥杀掉,这不是程序坏了,是环境就这样。看门狗会在下一次检查时把它拉起来,一般几十秒就好,但赶上机器停机几小时就没办法。
- 图片它看不见原图:QQ 图片存在它家 CDN 上,服务器这边拉不到,只能让 Muse 用浏览器去看图再回,所以图片回得更慢。
免责声明
- QQ 机器人号和对接号分别用小号,别拿主号挂桥,封号或凭据泄露只损小号。
- 机器人行为仍受平台规范约束,群发、频繁主动消息、违规内容可能触发限流或封禁。
- 仅供个人学习自用;容器回收、停机这些环境限制修不了,桥可能随时掉线、丢消息,不适合重要通知或关键业务。
Translated by AI from 简体中文Original (简体中文)
1
11
11 replies
Sort order