Skip to main content
HowOpenClawv2026.4.2

Module 2: Connecting Your Apps

Add Telegram, WhatsApp, Slack, and other messaging channels to your OpenClaw agent.

0 of 10 modules complete0%
6 min read
What you will learn
  • Create a Telegram bot and connect it to OpenClaw
  • Understand DM policies and when to use each one
  • Pair your account with the agent
  • Troubleshoot common channel connection issues

Why this matters

Right now your agent only works through the CLI. In this module, you connect it to a real messaging app so you can chat with it from your phone — just like texting a friend.

Why Telegram first

Telegram is the fastest channel to set up:

  • No phone number pairing required
  • Official Bot API (free, stable)
  • Works on any device
  • Takes about 2 minutes

You can add WhatsApp, Slack, Discord, and more later. See the Channels guide for all supported platforms.

Step 1: Create your bot

  1. Open Telegram and search for @BotFather
  2. Send /newbot
  3. Choose a display name (e.g., "My OpenClaw")
  4. Choose a username ending in bot (e.g., my_openclaw_bot)
  5. Copy the bot token BotFather gives you

Keep this token private — anyone with it can control your bot.

Step 2: Add the channel config

Open your OpenClaw configuration:

openclaw config edit

Add the Telegram channel to your configuration:

{
  "channels": {
    "telegram": {
      "token": "YOUR_BOT_TOKEN_HERE",
      "dmPolicy": "pairing"
    }
  }
}

Add to existing config

Do not replace your entire configuration file. Add the channels block alongside your existing settings.

Step 3: Understand DM policies

The dmPolicy setting controls who can message your agent:

PolicyWho can messageBest for
pairingUsers you approve one by oneGetting started (default)
allowlistOnly specific user IDs you listProduction use
openAnyone who finds your botNever recommended

Start with pairing — it lets you approve yourself easily, then switch to allowlist once you know your Telegram user ID.

To find your Telegram user ID, message @userinfobot — it replies with your numeric ID.

For allowlist mode:

{
  "channels": {
    "telegram": {
      "token": "YOUR_BOT_TOKEN_HERE",
      "dmPolicy": "allowlist",
      "allowedUsers": [123456789]
    }
  }
}

Step 4: Restart and pair

Apply your changes:

openclaw gateway restart

Check that the channel is connected:

openclaw gateway status

Now open Telegram and send /start to your bot. With pairing mode, you need to approve the request:

openclaw channels pair

This shows pending requests. Approve yours, and you are connected.

Step 5: Test it

Send a message to your bot in Telegram:

Hello! What can you do?

You should get a response within a few seconds. The agent reads your SOUL.md and USER.md on each message, sends the request to your AI provider, and streams the response back.

Troubleshooting

ProblemFix
Bot not respondingRun openclaw gateway status — is the gateway running?
"Not paired" errorRun openclaw channels pair and approve your request
Slow responsesCheck your AI model — cloud models need network access
Connection droppedRun openclaw gateway restart

Check logs for more detail:

openclaw logs --filter telegram

Validate your config file syntax:

openclaw config validate

Adding more channels

Once Telegram is working, you can add other channels the same way. Each channel gets its own section in the config with its own DM policy.

See the Channels guide for setup instructions for WhatsApp, Slack, Discord, iMessage, and more. If you hit issues connecting a channel, the troubleshooting guide covers the most common errors.

Finished this module?

Tracks your progress across all 10 modules