Overview
NanoClaw Pro uses a self-registering channel system that lets you connect multiple messaging platforms simultaneously. Each channel is installed as a skill and automatically registers itself at startup./add-whatsappQR code authenticationTelegram
/add-telegramBot token authenticationSlack
/add-slackOAuth app authenticationDiscord
/add-discordBot token authenticationGmail
/add-gmailOAuth authenticationCustom
Build your ownSee architecture below
How Channels Self-Register
Channels use a factory registry pattern that eliminates hardcoded channel lists.Channel Registry
Fromsrc/channels/registry.ts:
Channel Interface
Every channel implements this interface (fromsrc/types.ts):
connect()- Initialize connection to the platformsendMessage(jid, text)- Send a message to a JID (chat identifier)isConnected()- Check connection statusownsJid(jid)- Return true if this channel owns the given JIDdisconnect()- Clean up and close connection
setTyping(jid, isTyping)- Show typing indicatorsyncGroups(force)- Sync available groups from the platform
Self-Registration Pattern
When you run/add-whatsapp, the skill adds a file like this:
Barrel Import
The barrel file imports all channels, triggering registration:Startup Connection
Fromsrc/index.ts:513:
Channels with missing credentials are skipped silently. You’ll see a warning in the logs but NanoClaw will start with the channels that are configured.
Installing Channels
- Adds
src/channels/whatsapp.ts - Adds Baileys dependency to
package.json - Creates authentication flow
- Updates
src/channels/index.tsto import WhatsApp
store/auth/ (session files)
Telegram
- Adds
src/channels/telegram.ts - Adds
node-telegram-bot-apidependency - Prompts for bot token
- Updates barrel import
.env (TELEGRAM_BOT_TOKEN)
Slack
- Adds
src/channels/slack.ts - Adds
@slack/boltdependency - Guides OAuth app setup
- Updates barrel import
.env (SLACK_BOT_TOKEN, SLACK_SIGNING_SECRET)
Discord
- Adds
src/channels/discord.ts - Adds
discord.jsdependency - Prompts for bot token
- Updates barrel import
.env (DISCORD_BOT_TOKEN)
Gmail
- Adds
src/channels/gmail.ts - Adds Gmail API dependencies
- Guides OAuth setup
- Updates barrel import
.env and store/gmail-token.json
Switching Between Channels
You don’t “switch” between channels — they all run simultaneously. Messages route to the appropriate channel based on JID (chat identifier).How Message Routing Works
Fromsrc/router.ts:46:
- WhatsApp group:
[email protected] - WhatsApp DM:
[email protected] - Telegram:
telegram:123456789 - Slack:
slack:C01ABC123 - Discord:
discord:987654321
ownsJid() method checks if the JID matches its pattern.
Registering Groups Across Channels
You can register groups from different channels:groups/whatsapp_family-chat/groups/telegram_dev-team/
Available Channels (Outbound)
Checking Available Groups
From the main channel:Syncing Groups
Channels that supportsyncGroups() can refresh their group list:
Channel-Specific Features
/add-image-vision, /add-voice-transcription)
Authentication: QR code (expires ~20 days, requires re-scan)
Telegram
Typing indicators: Yes Group sync: Yes Media support: Yes (native) Authentication: Bot token (never expires)Slack
Typing indicators: Limited (only in DMs) Group sync: Yes (channels only, not private channels unless bot is invited) Media support: Yes (file uploads) Authentication: OAuth (requires app setup)Discord
Typing indicators: Yes Group sync: Yes (only servers where bot is added) Media support: Yes Authentication: Bot token (never expires)Gmail
Typing indicators: N/A (email) Group sync: N/A (threads identified by subject) Media support: Attachments Authentication: OAuth (refresh token stored)Building a Custom Channel
Step 1: Create Channel File
Createsrc/channels/signal.ts:
Step 2: Add to Barrel Import
Editsrc/channels/index.ts:
Step 3: Set Credentials
Add to.env:
Step 4: Restart
Architecture Diagram
Best Practices
Use One Main Channel
Designate one channel (usually WhatsApp or Telegram) as your main administrative channel.
Separate Contexts
Use different channels for different contexts: WhatsApp for family, Slack for work, Telegram for dev team.
Monitor Credentials
Set up alerts for authentication failures. WhatsApp QR codes expire every ~20 days.
Test Before Deploying
Test new channels in a development environment before adding to production.
Troubleshooting
Channel Not Loading
Check logs:Multiple Channels Fighting for Same JID
Symptom: Messages sent to wrong channel Cause: Two channels returningtrue for ownsJid(jid)
Solution: Make JID prefixes unique:
- WhatsApp:
@s.whatsapp.net,@g.us - Telegram:
telegram: - Slack:
slack: - Discord:
discord:
Messages Not Routing
Check router:ownsJid().
Related Features
- Container Isolation - How channels run securely
- Memory System - Per-group memory across channels
- Scheduled Tasks - Tasks can send to any channel