Quick Start
- Web Mode (Easiest)
- Cloud API (Production)
- Python SDK
How It Works
Cloud API vs Web Mode
| Feature | Cloud API | Web Mode |
|---|---|---|
| Setup | Meta developer account + tokens | QR code scan |
| Stability | Official, stable | Reverse-engineered, may break |
| Webhooks | Required (public HTTPS) | Not needed |
| Groups | DMs only | DMs + groups |
| Risk | None | Account may be banned |
| Best for | Production | Development, personal use |
Message Filtering
By default, the bot responds only to self-chat — when you message your own number. This prevents it from replying to every conversation.Four Layers of Protection
Stale Message Guard
Messages older than when the bot connected are dropped. Prevents replaying old conversations on reconnect.
Self-Chat Check
Only messages where sender = chat JID pass.
Outgoing Guard
Your messages sent to other people’s chats are always blocked — even if they’re in the allowlist.
Allowlists
Optionally allow specific phone numbers or groups.
Expand Who Can Message the Bot
- Self-Only (Default)
- Specific Numbers
- Specific Groups
- Everyone
Filtering Matrix
| Scenario | Default | --respond-to 123 | --respond-to-groups g@g.us | --respond-to-all |
|---|---|---|---|---|
| Self-chat (your own number) | ✅ | ✅ | ✅ | ✅ |
| Your msg in someone else’s chat | ❌ | ❌ | ❌ | ✅ |
| DM from 123 | ❌ | ✅ | ❌ | ✅ |
| DM from 999 | ❌ | ❌ | ❌ | ✅ |
| Group g@g.us | ❌ | ❌ | ✅ | ✅ |
| Other group | ❌ | ❌ | ❌ | ✅ |
| Old/offline messages | ❌ | ❌ | ❌ | ❌ |
Phone numbers are normalized automatically —
+1-234-567-890 and 1234567890 match the same number.Python SDK Filtering
YAML Config
Built-in Commands
| Command | Description |
|---|---|
/help | Show available commands |
/status | Bot info, model, uptime |
/new | Reset conversation session |
CLI Options
| Flag | Description | Example |
|---|---|---|
--mode | cloud (default) or web | --mode web |
--respond-to | Allowed phone numbers (comma-separated or repeated) | --respond-to 123,456 or --respond-to 123 --respond-to 456 |
--respond-to-groups | Allowed group JIDs (comma-separated or repeated) | --respond-to-groups grp@g.us |
--respond-to-all | Respond to everyone | --respond-to-all |
--creds-dir | Credentials directory | --creds-dir ~/.myapp/wa |
--agent | Agent YAML config | --agent agents.yaml |
--memory | Enable conversation memory | --memory |
--web | Enable web search tool | --web |
--thinking | Extended thinking mode | --thinking high |
--auto-approve | Auto-approve tool calls | --auto-approve |
Architecture
Key Components
| Component | Role |
|---|---|
| WhatsAppBot | Main bot class — handles lifecycle, filtering, routing |
| WhatsAppWebAdapter | Bridges neonize (Go) events to Python asyncio |
| Session Manager | Per-user conversation sessions with expiry |
| Message Filter | Stale guard → self-chat check → allowlist check |
| AI Agent | Your configured agent processes the message and responds |
Troubleshooting
Bot responds to old messages on startup
Bot responds to old messages on startup
Fixed in latest version. The stale-message guard drops any message older than when the bot connected. If you still see this, update to the latest version:
Bot responds to all messages, not just self-chat
Bot responds to all messages, not just self-chat
Fixed in latest version. The default filter now checks that both the sender AND chat JID match (true self-chat), not just
IsFromMe. Update your installation.Decryption warnings in the logs
Decryption warnings in the logs
SessionCipher error: old counter
SessionCipher error: old counter
WebSocket close error on shutdown
WebSocket close error on shutdown
shell_tools error: /home/user not found
shell_tools error: /home/user not found
/home/user (a Linux path) on macOS. Fixed in latest version — the tool now automatically falls back to your home directory.Threading error on Ctrl+C
Threading error on Ctrl+C
QR code not showing
QR code not showing
- Use a modern terminal (iTerm2, Windows Terminal)
- Ensure
segnois installed:pip install 'praisonai[bot-whatsapp-web]' - If a saved session exists, no QR is needed. Delete to re-link:
Session expired
Session expired
WhatsApp Web sessions expire if your phone is offline for 14+ days. Delete and re-scan:

