Connect OpenClaw to WhatsApp and Telegram

Introduction: Chat Apps as Your Interface

This tutorial shows you how to connect OpenClaw to WhatsApp and Telegram, the two most popular chat platforms for OpenClaw automation. By the end, you'll be able to control OpenClaw from your favorite chat app, using the interface you already use every day. We'll cover setup for both platforms, explain how to interact with OpenClaw in group chats versus direct messages, and show you how to manage multiple platforms simultaneously.

OpenClaw works with WhatsApp, Telegram, Discord, Slack, Signal, iMessage, and more. Here's how to connect your favorite chat app so you can automate tasks by simply sending a message.

WhatsApp Setup: Using Baileys Protocol

OpenClaw connects to WhatsApp using Baileys, an open-source library that mimics the WhatsApp web client. You don't need to use the official WhatsApp API (which has strict limits and requires business approval).

How It Works

When you run openclaw onboard, OpenClaw will ask if you want WhatsApp integration. If you say yes, it will display a QR code in your terminal.

What to expect: A large QR code will appear. Point your phone's camera at it (or use a QR code scanner app) and scan it.

Why this matters: This QR code is WhatsApp's way of authenticating without storing your password. It's the same technology WhatsApp Web uses—scanning the code links your account to OpenClaw without ever sharing your password.

When the scan completes, your phone will be linked. OpenClaw can now:

  • Receive direct messages from your contacts
  • Receive group messages when mentioned
  • Send replies back to you

Important Notes About WhatsApp

WhatsApp's terms of service technically restrict automation. Using an automated bot technically violates their terms. However, many users run automation bots on WhatsApp without issues. Here are your options:

  1. Accept the risk. Most users do. WhatsApp tolerates bot usage as long as you don't spam or use it for commercial purposes.
  2. Use a separate phone number. Set up a second SIM or use a VoIP service. Assign that number to OpenClaw.
  3. Use Telegram instead. Telegram explicitly allows and encourages bots. It's more automation-friendly.

For work or sensitive automation, we recommend option 2 or 3.

Telegram Setup: Bot API Method

Telegram officially supports bots and encourages automation. This is the most straightforward setup.

Step 1: Create Your Bot

Open Telegram and search for "@BotFather." Start a chat with it. Send the message:

/newbot

BotFather will ask for a name and username for your bot. You can use something like "MyOpenClawBot" and "my_openclaw_bot."

What to expect: BotFather will generate a token (a long alphanumeric string). This is your bot's authentication key.

Why this matters: The token proves that you own this bot. It's like a password; keep it secret.

Step 2: Configure OpenClaw

You have two options to add the Telegram bot to OpenClaw:

Option A: During initial onboarding

When you run openclaw onboard, select Telegram and paste the bot token when asked.

Option B: Modify the config file directly

Edit your OpenClaw config file (usually ~/.openclaw/config.yaml):

telegram:
  botToken: "YOUR_BOT_TOKEN_HERE"
  enabled: true

Then restart the daemon: openclaw daemon restart

What to expect: OpenClaw will connect to Telegram. Your bot is now live.

What to look for: The bot status should show as "online" in BotFather. In Telegram, you should see your bot listed in the contacts you've chatted with.

Step 3: Interact with Your Bot

Search for your bot in Telegram using the username you created (e.g., "@my_openclaw_bot"). Start a chat and send a message:

"What's the current date?"

You're done when: OpenClaw responds with today's date (or whichever answer is appropriate).

Discord Setup: Official Bot Integration

Discord is another excellent choice for OpenClaw, especially for teams or communities.

Creating Your Discord Bot

  1. Go to discord.com/developers/applications
  2. Click "New Application" and give it a name
  3. Go to the "Bot" tab and click "Add Bot"
  4. Under the TOKEN section, click "Copy" to copy your bot token
  5. Paste this token into your OpenClaw config:
discord:
  token: "YOUR_BOT_TOKEN_HERE"
  enabled: true

Restart OpenClaw: openclaw daemon restart

Inviting Your Bot to a Server

In your Discord application settings:

  1. Go to OAuth2 > URL Generator
  2. Select scopes: "bot"
  3. Select permissions: "Send Messages," "Read Messages," "Manage Messages"
  4. Copy the generated URL and open it in a browser
  5. Select a server to invite the bot to

What to expect: The bot joins your server and appears in the member list.

How to use: In any channel where the bot has access, mention it: "@OpenClaw what are my options?"

Slack Setup: Bot Token Method

Slack is ideal for work teams.

Creating Your Slack App

  1. Go to api.slack.com/apps
  2. Click "Create New App" and choose "From scratch"
  3. Name it and select your workspace
  4. Go to OAuth & Permissions and add these scopes:
    • chat:write (send messages)
    • channels:history (read messages)
    • groups:history (read direct messages)
  5. Click "Install to Workspace" and authorize
  6. Copy your bot token from OAuth & Permissions
  7. Add to OpenClaw config:
slack:
  token: "YOUR_BOT_TOKEN"
  enabled: true

Restart: openclaw daemon restart

Multi-Platform: Running OpenClaw Everywhere

One OpenClaw instance can serve all platforms simultaneously. In your config file, enable multiple platforms:

whatsapp:
  enabled: true

telegram:
  botToken: "..."
  enabled: true

discord:
  token: "..."
  enabled: true

slack:
  token: "..."
  enabled: true

The daemon handles routing automatically. Your commands work the same way on any platform.

What to expect: You can ask OpenClaw the same question from Telegram, Discord, or WhatsApp, and get consistent responses.

Activation Patterns: DMs vs Groups

Direct Messages (DMs)

In one-on-one chats, OpenClaw responds to every message. Just type naturally:

"Clear my unread emails" "Deploy the staging branch" "What's in my calendar today?"

No mention needed. Every message triggers OpenClaw.

Group Chats

In group channels, mention OpenClaw to activate it:

"@OpenClaw what's the status of the production deployment?"

Why this matters: In busy group chats, responding to every message would be noisy and distracting. Mentions keep things organized.

What to look for: Only messages with your bot's mention are processed. Everything else is ignored.

Troubleshooting Chat Connection

"Bot is offline" (Telegram): Check that your bot token is correct and in the config. Restart the daemon.

"Message sent but no response" (WhatsApp): Make sure the QR scan completed fully. Check openclaw logs to see if there are errors.

**"Bot not appearing in Discord server:" Did you invite it with the right permissions? Check that "Send Messages" is enabled.

Want to disable a platform temporarily? Set enabled: false in the config:

whatsapp:
  enabled: false

Restart the daemon. The bot stays alive on other platforms but goes quiet on WhatsApp.

Next Steps

Now that your chat connection is live:

  1. Try your first automation from the chat app
  2. Add additional platforms if you want
  3. Install skills to expand what OpenClaw can do (email, browser, shell access)
  4. Set up persistent memory so OpenClaw remembers your preferences
In the next step, you will explore the best AI tools for Chat-based task automation. Browse the options, pick one that fits your workflow, and try it before continuing.

Discussion

  • Loading…

← Back to Academy