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 statusConnecting Channels
The easiest way to connect channels is the interactive CLI:
moltbot channels loginThis will:
- Show available channels
- Guide you through authentication
- Store credentials securely
- Test the connection
Setup
moltbot channels login whatsapp- A QR code will appear in your terminal
- Open WhatsApp on your phone
- Go to Settings → Linked Devices → Link a Device
- Scan the QR code
- Wait for "Connected" confirmation
Credentials Location
~/.clawdbot/credentials/whatsapp/<accountId>/creds.jsonConfiguration
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 telegramYou'll need a bot token from BotFather:
- Open Telegram and message @BotFather
- Send /newbot
- Follow the prompts to name your bot
- Copy the bot token (like 123456789:ABCdefGHI...)
- Paste when prompted by the CLI
Credentials Location
Token is stored based on your config:
~/.clawdbot/credentials/telegram-tokenOr via environment:
TELEGRAM_BOT_TOKEN=your-token-hereConfiguration
{
"channels": {
"telegram": {
"enabled": true,
"tokenFile": "~/.clawdbot/credentials/telegram-token",
"replyToMode": "thread"
}
}
}Reply Modes
| Mode | Behavior |
|---|---|
thread | Reply in threads (recommended for groups) |
direct | Reply directly to messages |
silent | No notification sound |
Bot Commands (Optional)
Set up slash commands in BotFather:
- Message @BotFather
- Send /setcommands
- Select your bot
- Send:
start - Start chatting
help - Show help
reset - Clear conversationDiscord
Setup
moltbot channels login discordYou'll need to create a Discord application:
- Go to Discord Developer Portal
- Click New Application
- Go to Bot section
- Click Add Bot
- Enable Message Content Intent under Privileged Gateway Intents
- Copy the bot token
- Paste when prompted by the CLI
Generate Invite Link
The CLI will generate an invite link, or create one manually:
- Go to OAuth2 → URL Generator
- Select scopes: bot, applications.commands
- Select permissions: Read Messages/View Channels, Send Messages, Embed Links, Read Message History
- 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.jsonConfiguration
{
"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 slackYou'll need to create a Slack app:
- Go to Slack API
- Click Create New App
- Choose From scratch
- Add bot scopes under OAuth & Permissions: chat:write, channels:history, groups:history, im:history, mpim:history
- Install to your workspace
- Copy the Bot User OAuth Token
- Paste when prompted
Credentials
# Via environment
SLACK_BOT_TOKEN=xoxb-...
SLACK_APP_TOKEN=xapp-...
# Or config
~/.clawdbot/moltbot.jsonConfiguration
{
"channels": {
"slack": {
"enabled": true,
"botToken": "xoxb-...",
"appToken": "xapp-..."
}
}
}Managing Channels
Check Status
moltbot channels statusOutput:
Channel Status Account
─────────────────────────────────
whatsapp connected +1234567890
telegram connected @MyBot
discord connected MyBot#1234
slack disconnectedDisconnect a Channel
moltbot channels logout whatsappReconnect
moltbot channels login whatsappCredential Storage Map
Quick reference for where credentials are stored:
| Channel | Location |
|---|---|
~/.clawdbot/credentials/whatsapp/<accountId>/creds.json | |
| Telegram | Config/env or ~/.clawdbot/credentials/telegram-token |
| Discord | Config/env (token file not yet supported) |
| Slack | Config/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
- Check Gateway is running: moltbot health
- Verify token is correct
- 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