How codevix26/whatsapp-ai-auto-reply-bot works
This is a WhatsApp auto-reply bot: startup validates configuration and launches the WhatsApp session; incoming text is passed to the AI reply function, which combines a configurable system prompt with the message and requests a completion from OpenRouter; the reply is sent back and the exchange is logged. The README also documents QR login and prompt customization. Relationships below are based on the README and the sampled source; the local session and log storage are implemented in the WhatsApp module, and no separate storage file appears in the tree.
Main entry points: whatsapp.js WhatsApp Session · ai.js AI Reply Service · index.js Startup & Config · SystemPrompt.js System Prompt
Components 11
Bot Runtime
- Startup & Config
app/index.js
WhatsApp Messaging
- WhatsApp Session
app/src/whatsapp/whatsapp.js - Incoming Message Handler
app/src/whatsapp/whatsapp.js - QR Login
app/src/whatsapp/whatsapp.js - Session & Log Storage
app/src/whatsapp/whatsapp.js
AI Replies
- System Prompt
app/src/ai/SystemPrompt.js - AI Reply Service
app/src/ai/ai.js
Other components
- WhatsApp User
- OpenRouter
- Terminal
Connections 13
- Startup & Config → WhatsApp Session: starts
app/index.js - WhatsApp User → WhatsApp: sends message
README.md - WhatsApp → WhatsApp Session: delivers events
app/src/whatsapp/whatsapp.js - WhatsApp Session → QR Login: renders QR
app/src/whatsapp/whatsapp.js - QR Login → Terminal: prints code
app/src/whatsapp/whatsapp.js - WhatsApp Session → Session & Log Storage: loads and saves
app/src/whatsapp/whatsapp.js - WhatsApp Session → Incoming Message Handler: registers handler
app/src/whatsapp/whatsapp.js - Incoming Message Handler → AI Reply Service: requests reply
app/src/whatsapp/whatsapp.js - AI Reply Service → System Prompt: builds prompt
app/src/ai/ai.js - AI Reply Service → OpenRouter: requests completion
app/src/ai/ai.js - AI Reply Service → Incoming Message Handler: returns reply
app/src/whatsapp/whatsapp.js - Incoming Message Handler → WhatsApp: sends reply
app/src/whatsapp/whatsapp.js - Incoming Message Handler → Session & Log Storage: writes log
app/src/whatsapp/whatsapp.js