Skip to main content

Prerequisites

  • A phone with WhatsApp installed
  • OrcBot installed and configured
  • Node.js 18+ installed
  • Stable internet connection
WhatsApp Business API is a paid service. This guide uses the free Baileys library which connects via WhatsApp Web protocol. Use responsibly and in compliance with WhatsApp’s Terms of Service.

How It Works

OrcBot uses the Baileys library to connect to WhatsApp as a linked device (similar to WhatsApp Web).

Initial Setup

1

Configure Session Path

Set where WhatsApp auth data is stored:
2

Start OrcBot

3

Scan QR Code

When you see “WhatsApp: New QR Code generated. Scan to link.” in the logs:
  1. Open WhatsApp on your phone
  2. Go to Settings → Linked Devices
  3. Tap “Link a Device”
  4. Scan the QR code displayed in your terminal
4

Connection Established

You’ll see:
OrcBot is now connected!

Configuration Options

Basic Settings

Auto-Reply Behavior

OrcBot responds to all incoming messages automatically.

Media Handling

Receiving Media

OrcBot automatically downloads and analyzes media:

Sending Media

Use the send_file skill:
Supported file types:
  • Images: .jpg, .png, .webp
  • Audio: .ogg, .mp3, .m4a
  • Video: .mp4, .mkv
  • Documents: .pdf, .doc, .xlsx, etc.

Voice Messages

Send text-to-speech voice notes:
OrcBot converts text to speech and sends as WhatsApp voice note.

Contact Management

Auto-Sync Contacts

OrcBot automatically syncs your WhatsApp contacts:

Search Contacts

Use the contact search API:

Get Recent Contacts

Reply Context & Threads

OrcBot preserves conversation threads:
Example conversation:

Group Chat Support

Auto-Reply in Groups

Or mention-based:

Group Message Detection

WhatsApp Status Updates

Replying to status updates can be intrusive. Only enable if you have a specific use case.

Enable Status Replies

When enabled:
  • OrcBot sees status updates from contacts
  • Can auto-react or reply to status
  • Status media is downloaded and analyzed

Status Detection

Session Persistence

How Sessions Work

Baileys stores auth credentials in multi-file format:

Backup Session

Restore Session

If you lose your session files, you’ll need to re-scan the QR code.

Reconnection Handling

OrcBot automatically reconnects on disconnection:
Disconnect reasons:
  • loggedOut - You logged out from phone (requires re-pairing)
  • connectionReplaced - Another device connected
  • Network issues - Auto-reconnects

Advanced Features

Context Profiling

When enabled, OrcBot analyzes message patterns:
This helps the agent:
  • Understand conversation context better
  • Provide more relevant responses
  • Track user preferences over time

Auto-Reactions

Enable emoji reactions to messages:
OrcBot can react with:
  • ✅ for completed tasks
  • 🔍 for searches in progress
  • ❌ for errors
  • 🤔 for clarification requests

Self-Chat Prefix

When messaging yourself, OrcBot adds a prefix to its messages:
This prevents infinite loops in self-chat mode.

Channel Detection

OrcBot uses 3-tier channel detection for sending messages:
JID formats:
  • WhatsApp individual: 1234567890@s.whatsapp.net
  • WhatsApp group: 1234567890-1234567890@g.us
  • Discord: 987654321098765432 (snowflake)
  • Telegram: 123456789 (numeric)

Troubleshooting

QR Code Not Showing

1

Check Logs

2

Verify Config

3

Clear Session

4

Check Terminal

Make sure your terminal supports QR code rendering. If not, check logs for the QR code event.

Connection Keeps Dropping

Possible causes:
  1. Network instability
  2. Multiple devices
    • Check linked devices on your phone
    • Unlink old sessions
  3. WhatsApp updates
    • Update Baileys: npm update @whiskeysockets/baileys
    • Restart OrcBot

Messages Not Being Received

Common issues:
  • Bot is muted on your phone
  • Message processing disabled: whatsappAutoReplyEnabled: false
  • Group admin restrictions

Media Download Failures

Ensure:
  • Directory exists and is writable
  • Sufficient disk space
  • Network connection is stable

”Logged Out” Error

If you see DisconnectReason.loggedOut:
  1. You manually logged out from phone
  2. WhatsApp detected suspicious activity
  3. Session expired (typically after 14 days of inactivity)
Fix: Clear session and re-pair

Best Practices

Reliability

  • Keep your phone connected to internet
  • Don’t log out of linked devices
  • Back up session files regularly
  • Monitor connection status in logs

Privacy

  • Don’t share session files (contain auth credentials)
  • Set restrictive permissions: chmod 700 ~/.orcbot/whatsapp-session
  • Disable status replies unless needed
  • Be cautious with auto-profiling in sensitive conversations

Performance

  • Limit media auto-downloads in busy groups
  • Set reasonable message processing limits
  • Use whatsappAutoReplyEnabled: false in high-traffic groups
  • Clean up old downloads periodically

Compliance

  • Follow WhatsApp Terms of Service
  • Don’t spam or send unsolicited messages
  • Respect user privacy and consent
  • Use business accounts for commercial purposes

Example Workflows

Personal Assistant

File Processing

Group Coordination