Setting Up Your First Channel
Connect OpenClaw to the messaging apps you use every day. Learn to integrate Telegram and WhatsApp for seamless communication.
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
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.
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
- Open the Telegram app on your phone or computer
- Search for @BotFather (official Telegram bot creator)
- Start a conversation with BotFather
- Send the command:
/start
Tutorial.alert.tip
Step 2.2: Create Your Bot
- Send BotFather:
/newbot - BotFather will ask for a name for your bot (this is the display name, e.g., "My OpenClaw Assistant")
- BotFather will ask for a username (must end in 'bot', e.g., "myopenclawbot")
- BotFather will respond with a bot token - COPY THIS TOKEN (you'll need it in the next step)
Tutorial.alert.warning
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.
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 ~/.openclaw/openclaw.json. Open it in your preferred text editor:
# On macOS/Linux: nano ~/.openclaw/openclaw.json # or code ~/.openclaw/openclaw.json # VS Code # or open ~/.openclaw/openclaw.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:
{
"agents": {
"defaults": {
"model": { "primary": "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.
Tutorial.alert.success
123456789:ABCdefGHIjklMNOpqrsTUVwxyz, your configuration would look like: "token": "123456789:ABCdefGHIjklMNOpqrsTUVwxyz"Step 3.3: Save and Restart Gateway
After saving your configuration:
- Save the configuration file
- Restart your OpenClaw Gateway to load the new configuration
# If Gateway is running as a service: openclaw gateway restart # Or if running manually, stop and restart: openclaw gateway --port 18789 --verbose
Test Your Connection
Now let's verify everything works!
Step 4.1: Find Your Bot on Telegram
- Open Telegram
- Search for your bot by its username (the one you created, e.g., "myopenclawbot")
- Start a conversation with your bot
- Send
/startto 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! 🎉
Tutorial.alert.success
- 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:
- Check Gateway is running:
openclaw gateway status - Verify token is correct: Check for typos in the configuration file
- Check Gateway logs: Look for error messages about Telegram connection
- 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:
Other Channels
Want to set up other channels? Here are quick links to their reference guides:
- WhatsApp Setup - QR code pairing with your WhatsApp account
- Discord Setup - Create a Discord bot and invite to servers
- All Channels - Complete list of supported messaging platforms
Each channel has its own setup process, but the general flow is similar: create/link account → get credentials → configure OpenClaw → test connection.