📋 WhatsApp Guide
💬 WhatsApp Integration Overview
MoltBot connects to WhatsApp using the Baileys library, which implements the WhatsApp Web protocol.
What You Can Do
- ✅ Chat with AI through WhatsApp
- ✅ Use in personal chats and groups
- ✅ Send/receive images and files
- ✅ Voice message support
- ✅ Group moderation features
- ✅ Automated responses
Requirements
- WhatsApp account (phone number)
- MoltBot installed and running
- Smartphone with WhatsApp app
- QR code scanner (WhatsApp app)
🔧 Setup & Pairing
Step 1: Enable WhatsApp Channel
# In config.yaml
channels:
whatsapp:
enabled: true
sessionName: "MoltBot-wa"
autoReconnect: true
Step 2: Start MoltBot
MoltBot start
Step 3: Scan QR Code
A QR code will appear in your terminal. Scan it with WhatsApp:
- Open WhatsApp on your phone
- Tap Menu (⋮) → Linked Devices
- Tap "Link a Device"
- Scan the QR code from terminal
Step 4: Verify Connection
Send yourself a message: "Hello MoltBot!"
✨ Features
Text Messages
You: What's the weather today?
Bot: [Fetches weather data]
You: Write a Python function to sort a list
Bot: [Generates code]
Image Analysis
You: [Sends photo]
You: What's in this image?
Bot: I see a sunset over mountains...
File Operations
You: [Sends PDF]
You: Summarize this document
Bot: [Reads and summarizes PDF]
Voice Messages
You: [Sends voice message]
Bot: [Transcribes and responds]
📱 Usage Examples
Personal Assistant
You: Remind me to call mom at 3pm
Bot: Reminder set for 3:00 PM today
You: What's on my calendar tomorrow?
Bot: [Lists calendar events]
Research Helper
You: Research the latest AI developments
Bot: [Browses web, compiles information]
You: Find flights to Tokyo next week
Bot: [Searches and presents options]
Coding Assistant
You: Debug this error: [paste error]
Bot: [Analyzes and suggests fixes]
You: Create a React component for a login form
Bot: [Generates complete code]
👥 Group Chat Features
Enable in Groups
# In config.yaml
channels:
whatsapp:
groups:
enabled: true
mentionOnly: true # Only respond when mentioned
Group Commands
@MoltBot help
@MoltBot summarize last 50 messages
@MoltBot translate to Spanish: Hello everyone!
Moderation
@MoltBot ban @user
@MoltBot mute @user 1h
@MoltBot set rules: No spam, be respectful
🔧 Troubleshooting
QR Code Not Appearing
# Check logs
MoltBot logs
# Restart WhatsApp channel
MoltBot channel restart whatsapp
Connection Lost
# Delete session and re-pair
rm -rf ~/.MoltBot/whatsapp-session
MoltBot start
Messages Not Sending
# Check WhatsApp status
MoltBot status
# Verify phone has internet connection
❓ FAQ
Is this the official WhatsApp API?
No, MoltBot uses WhatsApp Web protocol (Baileys library). It works like
WhatsApp Web on your browser.
Can my account get banned?
Unlikely if used reasonably. Avoid spam, excessive automation, or violating
WhatsApp ToS.
Does my phone need to be online?
Initially yes for pairing. After that, MoltBot works independently.
Can I use multiple WhatsApp accounts?
Yes, configure multiple sessions with different names in config.yaml.