/add-whatsapp - WhatsApp Channel Skill
Purpose
Add WhatsApp as a communication channel for NanoBob.
Prerequisites
- WhatsApp phone number for the bot
- Ability to scan QR code for authentication
What This Skill Does
- Creates
src/channels/whatsapp.tswith WhatsApp channel implementation - Adds import to
src/channels/index.ts - Sets up authentication flow using Baileys library
- Creates authentication storage in
store/auth/
Usage
Inside the claude CLI, run:
/add-whatsapp
Then follow prompts to:
- Enter the WhatsApp number for the bot
- Scan the QR code displayed
- Wait for authentication to complete
- Register WhatsApp groups
Implementation Details
Channel File: `src/channels/whatsapp.ts`
import { registerChannel, ChannelOpts } from './registry.js';
import makeWASocket from '@whiskeysockets/baileys';
export class WhatsAppChannel implements Channel {
// Implementation using Baileys library
// Handles WhatsApp message reception and sending
// Manages authentication state
}
registerChannel('whatsapp', (opts: ChannelOpts) => {
// Check for auth credentials
return new WhatsAppChannel(opts);
});
Dependencies
Add to package.json:
"@whiskeysockets/baileys": "^6.7.0"
Authentication
Credentials stored in store/auth/whatsapp.json
Post-Installation
- Run
npm installto install new dependencies - Run
npm run buildto compile TypeScript - Run authentication flow
- Restart NanoBob
- Use
@Bobin your WhatsApp chats