How I Built Luna: A Multi-Dimensional WhatsApp Bot That Survives Meta's Ban Hammer
说明与用途
WhatsApp 机器人 Luna 在不需要交互式终端的 VPS 上可靠运行,避免因快速反应导致的封禁,防止服务器过载,并且不再触及 Redis 和 MongoDB 的免费层限制。
问题
Deploying a WhatsApp bot on VPS without interactive terminal, avoiding bans from fast reactions, preventing server overload, and overcoming free tier Redis limits.
结果
The bot now operates reliably on VPS without interactive terminals, avoids WhatsApp bans by throttling reactions, runs without server overload, and no longer hits free tier limits on Redis or MongoDB.
工作流
- 1. Deploy luna_connect to generate session tokens via web QR pairing.
- 2. Set SESSION env variable with generated token.
- 3. Disable REACT=true; enable reaction queueing with BullMQ.
- 4. For bloombot, run three instances and rotate them to distribute traffic.
- 5. Move bot to a higher-tier VPS, add pm2 and an Express dashboard on port 3000.
- 6. Replace free-tier Upstash Redis with self-hosted or managed Redis; use MongoDB Atlas instead of local MongoDB.
证据
QR on server: Some VPS don't give you interactive terminal. You can't scan. Fix: I built luna_connect / xserver.frionode.online — generates BLOOM~ / LUNA~ session tokens via pairing code. Use that in SESSION env.
WhatsApp bans: Not random. Caused by fast reactions + one account sending too fast in groups. Fix: REACT=false by default, queue reactions with BullMQ, and for bloombot I use triple instance rotation to spread load.
Server overload: Luna logs, spawns Pokemon, watches statuses — kills small VPS. Fix: moved off free tiers to better server, added pm2 + Express dashboard on :3000 to monitor uptime.
Upstash Redis limit: Free tier hits limit fast with usage tracking/caching. Fix: self-host Redis or use managed Redis with higher limit. Don't use local Mongo on VPS either, use Atlas.
- 记录日期: 2026-10-11T14:56:12.040Z