Moltbot Channel Integration

Moltbot can connect to multiple messaging platforms simultaneously. This guide covers how to set up each channel.

TL;DR

# Interactive setup for all channels moltbot channels login # Or specific channels moltbot channels login whatsapp moltbot channels login telegram moltbot channels login discord moltbot channels login slack # Check channel status moltbot channels status

Connecting Channels

The easiest way to connect channels is the interactive CLI:

moltbot channels login

This will:

  1. Show available channels
  2. Guide you through authentication
  3. Store credentials securely
  4. Test the connection

WhatsApp

Setup

moltbot channels login whatsapp
  1. A QR code will appear in your terminal
  2. Open WhatsApp on your phone
  3. Go to Settings → Linked Devices → Link a Device
  4. Scan the QR code
  5. Wait for "Connected" confirmation

Credentials Location

~/.clawdbot/credentials/whatsapp/<accountId>/creds.json

Configuration

In ~/.clawdbot/moltbot.json:

{ "channels": { "whatsapp": { "enabled": true, "allowFrom": ["allowlist.json"] } } }

Allowlist

Control who can message your bot:

nano ~/.clawdbot/credentials/whatsapp-allowFrom.json
{ "numbers": [ "+1234567890", "+0987654321" ], "groups": [ "MyGroupName" ] }
Session Expired?WhatsApp sessions can expire. Re-run moltbot channels login whatsapp to reconnect.

Telegram

Setup

moltbot channels login telegram

You'll need a bot token from BotFather:

  1. Open Telegram and message @BotFather
  2. Send /newbot
  3. Follow the prompts to name your bot
  4. Copy the bot token (like 123456789:ABCdefGHI...)
  5. Paste when prompted by the CLI

Credentials Location

Token is stored based on your config:

~/.clawdbot/credentials/telegram-token

Or via environment:

TELEGRAM_BOT_TOKEN=your-token-here

Configuration

{ "channels": { "telegram": { "enabled": true, "tokenFile": "~/.clawdbot/credentials/telegram-token", "replyToMode": "thread" } } }

Reply Modes

ModeBehavior
threadReply in threads (recommended for groups)
directReply directly to messages
silentNo notification sound

Bot Commands (Optional)

Set up slash commands in BotFather:

  1. Message @BotFather
  2. Send /setcommands
  3. Select your bot
  4. Send:
start - Start chatting help - Show help reset - Clear conversation

Discord

Setup

moltbot channels login discord

You'll need to create a Discord application:

  1. Go to Discord Developer Portal
  2. Click New Application
  3. Go to Bot section
  4. Click Add Bot
  5. Enable Message Content Intent under Privileged Gateway Intents
  6. Copy the bot token
  7. Paste when prompted by the CLI

Generate Invite Link

The CLI will generate an invite link, or create one manually:

  1. Go to OAuth2 → URL Generator
  2. Select scopes: bot, applications.commands
  3. Select permissions: Read Messages/View Channels, Send Messages, Embed Links, Read Message History
  4. Use the generated URL to add bot to your server

Credentials Location

# Via environment (recommended) DISCORD_BOT_TOKEN=your-token DISCORD_APPLICATION_ID=your-app-id # Or config file ~/.clawdbot/moltbot.json

Configuration

{ "channels": { "discord": { "enabled": true, "replyToMode": "thread", "allowedGuilds": ["123456789"], "allowedChannels": ["987654321"] } } }
Bot Not Responding?Make sure Message Content Intent is enabled in the Developer Portal. Without it, your bot can't read message content.

Slack

Setup

moltbot channels login slack

You'll need to create a Slack app:

  1. Go to Slack API
  2. Click Create New App
  3. Choose From scratch
  4. Add bot scopes under OAuth & Permissions: chat:write, channels:history, groups:history, im:history, mpim:history
  5. Install to your workspace
  6. Copy the Bot User OAuth Token
  7. Paste when prompted

Credentials

# Via environment SLACK_BOT_TOKEN=xoxb-... SLACK_APP_TOKEN=xapp-... # Or config ~/.clawdbot/moltbot.json

Configuration

{ "channels": { "slack": { "enabled": true, "botToken": "xoxb-...", "appToken": "xapp-..." } } }

Managing Channels

Check Status

moltbot channels status

Output:

Channel Status Account ───────────────────────────────── whatsapp connected +1234567890 telegram connected @MyBot discord connected MyBot#1234 slack disconnected

Disconnect a Channel

moltbot channels logout whatsapp

Reconnect

moltbot channels login whatsapp

Credential Storage Map

Quick reference for where credentials are stored:

ChannelLocation
WhatsApp~/.clawdbot/credentials/whatsapp/<accountId>/creds.json
TelegramConfig/env or ~/.clawdbot/credentials/telegram-token
DiscordConfig/env (token file not yet supported)
SlackConfig/env
Allowlists~/.clawdbot/credentials/<channel>-allowFrom.json

Multi-Account Setup

Run multiple accounts of the same channel:

{ "channels": { "telegram": { "accounts": { "personal": { "enabled": true, "tokenFile": "~/.clawdbot/credentials/telegram-personal" }, "work": { "enabled": true, "tokenFile": "~/.clawdbot/credentials/telegram-work" } } } } }

Common Issues

"Unauthorized" ErrorToken is invalid or expired. Get a new one and run moltbot channels login again.
WhatsApp QR Code Not Showing

Ensure you're running in an interactive terminal:

moltbot channels login whatsapp # Not: moltbot channels login whatsapp &
Discord Bot Offline
  1. Check Gateway is running: moltbot health
  2. Verify token is correct
  3. Check bot has proper permissions in server
Rate LimitedSlow down! Some channels limit how fast you can send messages. Moltbot handles this automatically, but excessive use may trigger limits.

Security Best Practices

  • Never share bot tokens publicly
  • Use allowlists to control who can message your bot
  • Regularly rotate tokens for sensitive deployments
  • Keep credentials out of version control
  • Use environment variables in production

Next Steps

Channel Integration Guide | Moltbot Setup Guide