This tutorial will walk you through connecting OpenClaw (formerly Moltbot, Clawdbot) to your first messaging channel. We'll use Telegram as our example since it's the easiest to set up, but the process is similar for WhatsApp and Discord. Estimated time: 10-15 minutes.

📚 Reference: For complete channel features, advanced configuration, and all platform options, see the Channels Reference Guide.

Prerequisites

Before starting, ensure you have:

  • OpenClaw installed and running - Complete the Getting Started Tutorial first
  • Gateway running - Your OpenClaw Gateway should be active
  • Telegram account (for this tutorial) - Or WhatsApp/Discord if you prefer
  • Access to terminal/command line

Step 1: Choose Your Channel

OpenClaw supports multiple messaging platforms. For this tutorial, we'll use Telegram because:

  • Easiest to set up (just create a bot)
  • No phone number required
  • Great for testing and learning
  • Works on all platforms
💬 Telegram

Easiest setup, bot-based, great for beginners

📱 WhatsApp

QR code pairing, uses your personal account

🎮 Discord

Bot-based, great for communities and servers

For other channels: See the Channels Reference for WhatsApp, Discord, Slack, Signal, iMessage, and more.

Step 2: Create a Telegram Bot

Telegram uses bots, which are special accounts that can be controlled programmatically. Here's how to create one:

Step 2.1: Open Telegram and Find BotFather

  1. Open the Telegram app on your phone or computer
  2. Search for @BotFather (official Telegram bot creator)
  3. Start a conversation with BotFather
  4. Send the command: /start
💡 Tip: BotFather is the official Telegram bot that helps you create and manage bots. You can access it at t.me/botfather.

Step 2.2: Create Your Bot

  1. Send BotFather: /newbot
  2. BotFather will ask for a name for your bot (this is the display name, e.g., "My OpenClaw Assistant")
  3. BotFather will ask for a username (must end in 'bot', e.g., "myopenclawbot")
  4. BotFather will respond with a bot token - COPY THIS TOKEN (you'll need it in the next step)
⚠️ Important: Keep your bot token secret! It's like a password. Don't share it publicly or commit it to version control.

Step 2.3: (Optional) Configure Your Bot

You can customize your bot with BotFather commands:

  • /setdescription - Set what your bot does
  • /setabouttext - Set bot bio
  • /setuserpic - Set bot profile picture

These are optional - your bot will work without them.

Step 3: Configure OpenClaw

Now we'll add your Telegram bot to OpenClaw's configuration.

Step 3.1: Open Configuration File

Your OpenClaw configuration is located at ~/.clawdbot/moltbot.json. Open it in your preferred text editor:

Open Configuration
# On macOS/Linux:
nano ~/.clawdbot/moltbot.json
# or
code ~/.clawdbot/moltbot.json  # VS Code
# or
open ~/.clawdbot/moltbot.json  # Default editor

Step 3.2: Add Telegram Configuration

Add the Telegram channel configuration to your file. If you already have a configuration file, add the channels section:

Telegram Configuration
{
  "agent": {
    "model": "anthropic/claude-opus-4-5"
  },
  "channels": {
    "telegram": {
      "enabled": true,
      "token": "YOUR_BOT_TOKEN_HERE"
    }
  }
}

Replace YOUR_BOT_TOKEN_HERE with the token you copied from BotFather.

✅ Example: If your token was 123456789:ABCdefGHIjklMNOpqrsTUVwxyz, your configuration would look like: "token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz"

Step 3.3: Save and Restart Gateway

After saving your configuration:

  1. Save the configuration file
  2. Restart your OpenClaw Gateway to load the new configuration
Restart Gateway
# If Gateway is running as a service:
openclaw gateway restart

# Or if running manually, stop and restart:
openclaw gateway --port 18789 --verbose

Step 4: Test Your Connection

Now let's verify everything works!

Step 4.1: Find Your Bot on Telegram

  1. Open Telegram
  2. Search for your bot by its username (the one you created, e.g., "myopenclawbot")
  3. Start a conversation with your bot
  4. Send /start to initialize the bot

Step 4.2: Send a Test Message

Send a simple message to your bot, like:

  • "Hello!"
  • "What can you do?"
  • "Introduce yourself"

Your OpenClaw assistant should respond! If it does, congratulations - your channel is working! 🎉

✅ Success Indicators:
  • Bot responds to your messages
  • No errors in Gateway logs
  • Messages appear in both directions

Troubleshooting Common Issues

Bot Not Responding

If your bot doesn't respond:

  1. Check Gateway is running: openclaw gateway status
  2. Verify token is correct: Check for typos in the configuration file
  3. Check Gateway logs: Look for error messages about Telegram connection
  4. Restart Gateway: Sometimes a restart fixes connection issues

"Bot token is invalid" Error

This usually means:

  • Token was copied incorrectly (check for extra spaces)
  • Token was regenerated (get a new one from BotFather)
  • Configuration file has syntax errors (check JSON formatting)

Bot Responds but Gateway Shows Errors

If bot works but you see errors:

  • Check Gateway logs for specific error messages
  • Verify your AI model is configured correctly
  • Ensure you have API credits/quota available

For more troubleshooting help, see our Troubleshooting Guide.

Next Steps

Now that you have a channel connected, here's what to explore next:

🔧 Configure More Channels

Add WhatsApp, Discord, or other platforms.

Channels Reference →

📚 Learn to Use OpenClaw

Master commands, features, and best practices.

Usage Guide →

🔧 Install Skills

Extend functionality with community-built skills.

Browse Skills →

Other Channels

Want to set up other channels? Here are quick links to their reference guides:

Each channel has its own setup process, but the general flow is similar: create/link account → get credentials → configure OpenClaw → test connection.

Continue Learning