Features

How to Set Up an OpenClaw Telegram Bot: Complete Guide 2026

Chris DiYanni·Founder & AI/ML Engineer·

A complete, step-by-step guide to connecting a Telegram bot to your OpenClaw AI agent. From BotFather to production-ready configuration, with security best practices most guides skip.

Telegram is the single most popular messaging channel in the OpenClaw ecosystem. It is easy to see why. The BotFather setup takes five minutes, the long-polling transport requires zero webhook infrastructure, and the 2 billion monthly active users on the platform mean your agent is reachable wherever your team or customers already are.

But "it works" and "it works securely" are two different things. Most Telegram setup guides stop at getting a response from your bot. They skip DM pairing, group chat configuration, rate limiting, and the inline command features that make a Telegram bot actually useful in production. That gap between a demo and a deployment is where things go wrong.

This guide covers the full process. We will set up a Telegram bot from scratch, configure the OpenClaw Telegram plugin with every relevant option, lock it down with DM pairing and access controls, configure group chat behavior, add inline commands, and troubleshoot the issues you will actually run into. If you have already installed OpenClaw, this guide picks up right where that one leaves off.

Why Telegram Is the Most Popular OpenClaw Channel

Before diving into setup, it helps to understand why Telegram dominates the OpenClaw channel ecosystem. There are several concrete reasons:

Zero infrastructure requirements. Unlike Slack or WhatsApp, Telegram bots can use long-polling instead of webhooks. That means your OpenClaw instance does not need a public URL or a reverse proxy to receive messages. The bot reaches out to Telegram's servers to check for new messages. This works behind NAT, behind firewalls, and even on a local development machine with no port forwarding.

Instant bot creation. Telegram's BotFather is the fastest bot provisioning system across any platform. You open a chat, send a few commands, and have a working bot token in under two minutes. No app review process. No business verification. No OAuth consent screen configuration. Just a token.

Rich message formatting. Telegram supports Markdown, code blocks, inline buttons, images, files, voice messages, and location sharing natively. Your OpenClaw agent's responses render with proper formatting out of the box.

Cross-platform reach. Telegram runs on iOS, Android, macOS, Windows, Linux, and the web. Your agent is accessible from every device without any platform-specific setup.

Group chat support. You can add your bot to group chats where it monitors conversations and responds to @mentions or keywords. This is especially useful for team scenarios where multiple people need access to the same agent.

No cost. There are no fees for creating Telegram bots, no per-message charges, and no premium tier required. The only costs are running your OpenClaw instance and the AI model API usage.

For all of these reasons, Telegram is typically the first channel people connect when setting up OpenClaw, and often the primary channel they use in production.

Prerequisites

Before starting, make sure you have:

  • A running OpenClaw instance. If you have not set one up yet, follow our complete OpenClaw installation guide first. You need a working instance with Docker, an AI model API key configured, and the ability to edit your openclaw.yaml configuration file.
  • A Telegram account. Any personal Telegram account works. You do not need a business account or a premium subscription.
  • SSH access to your server (if self-hosting) or access to your OpenClaw configuration files.

Estimated time to complete this guide: 15-30 minutes for a basic setup, 45-60 minutes if you configure group chats, inline commands, and advanced security settings.

Step 1: Create a Telegram Bot with BotFather

Every Telegram bot starts with BotFather, Telegram's official bot management tool. Here is the process:

1.1 Open BotFather

In Telegram, search for @BotFather and open a chat with it. Verify that it has a blue checkmark next to its name. This is the official BotFather. There are impersonators. If there is no checkmark, you are talking to the wrong account.

1.2 Create a New Bot

Send the command:

/newbot

BotFather will ask two questions:

  1. Name: The display name for your bot. This appears in conversations. Example: "Acme Support Agent" or "DevOps Monitor". Use something descriptive that your team or customers will recognize.
  2. Username: A unique identifier that ends in bot. Example: acme_support_bot or devops_monitor_bot. This cannot be changed later, so choose carefully.

After you provide both, BotFather responds with your bot token. It looks something like this:

7123456789:AAGh3kL9mN2pQ4rS5tUvWxYz-aBcDeFgHiJ

Save this token immediately. Treat it like a password. Anyone with this token can control your bot, read messages sent to it, and send messages from it. Do not commit it to version control, paste it in a public channel, or share it in screenshots.

1.3 Configure Bot Settings in BotFather

While you are in BotFather, configure these optional but recommended settings:

# Set a profile picture for your bot
/setuserpic
# Then upload an image

# Set a description (shown when users first open the bot)
/setdescription
# Example: "AI-powered support agent for Acme Corp. Ask me anything about our products."

# Set an about text (shown in the bot's profile)
/setabouttext
# Example: "Acme Corp's AI assistant, powered by OpenClaw"

# Enable inline mode (optional, for inline queries)
/setinline
# Set a placeholder like: "Ask me anything..."

# Enable group chat support
/setjoingroups
# Select your bot, then choose "Enable"

# Set group privacy mode
/setprivacy
# Choose "Disable" if you want the bot to see all group messages
# Choose "Enable" if you want it to only see commands and @mentions

The privacy mode setting is important for group chats. We will cover this in detail in the group chat section below.

1.4 Save the Token Securely

Add your bot token to the .env file on your OpenClaw server:

# SSH into your server
ssh openclaw@YOUR_SERVER_IP

# Add the token to your .env file
nano ~/openclaw/.env

# Add this line:
TELEGRAM_BOT_TOKEN=7123456789:AAGh3kL9mN2pQ4rS5tUvWxYz-aBcDeFgHiJ

If you are using a secrets manager (recommended for production), store the token there instead and reference it in your environment configuration.

Step 2: Configure the OpenClaw Telegram Plugin

With the bot token in place, you need to enable and configure the Telegram plugin in your OpenClaw configuration file.

2.1 Basic Configuration

Open your openclaw.yaml file and add the Telegram channel configuration:

# openclaw.yaml

channels:
  telegram:
    enabled: true
    dmPolicy: "pairing"    # Require approval for new users (recommended)

plugins:
  entries:
    telegram:
      enabled: true

This is the minimum configuration to get Telegram working. The dmPolicy: "pairing" setting is critical for security and is covered in detail in the security section below.

2.2 Full Configuration Reference

Here is a comprehensive configuration with all available Telegram options:

# openclaw.yaml - Complete Telegram configuration

channels:
  telegram:
    enabled: true
    dmPolicy: "pairing"          # "pairing" (recommended) or "open"
    # allowedUserIds:            # Optional: whitelist specific Telegram user IDs
    #   - "123456789"
    #   - "987654321"

plugins:
  entries:
    telegram:
      enabled: true

agents:
  defaults:
    model: "openrouter/anthropic/claude-sonnet-4"
    sandbox:
      mode: "all"                # Sandbox all tool executions
    # systemPrompt: |            # Optional: customize the agent's personality
    #   You are a helpful AI assistant for Acme Corp.
    #   Always be professional and concise.
    #   If you don't know the answer, say so.

gateway:
  bind: "loopback"               # NEVER change this to "0.0.0.0"
  auth:
    mode: "token"                # NEVER set this to "none"
  mDNS:
    enabled: false               # Disable network broadcasting

2.3 Apply the Configuration

After editing your configuration, restart the OpenClaw containers:

cd ~/openclaw
docker compose down && docker compose up -d

Check the logs to confirm the Telegram plugin loaded successfully:

docker compose logs -f openclaw 2>&1 | grep -i telegram

You should see a log line indicating the Telegram plugin initialized and is polling for messages. If you see an error about an invalid token, double-check your .env file for typos or trailing whitespace.

Step 3: Test Your Telegram Bot

With the configuration applied and containers running, test the bot:

  1. Open Telegram and search for your bot by its username (e.g., @acme_support_bot)
  2. Click Start to begin a conversation
  3. Send a message: "Hello, what can you help me with?"

If you set dmPolicy: "pairing" (recommended), the bot will not respond yet. You need to approve the pairing first. Check the OpenClaw logs or your admin interface for the pairing request, approve it, and then resend your message.

If you set dmPolicy: "open", the bot should respond immediately with a message generated by your configured AI model.

If you get no response at all, see the troubleshooting section at the end of this guide.

Step 4: Understanding DM Policies (Security-Critical)

The dmPolicy setting is the single most important security configuration for your Telegram bot. It determines who can interact with your AI agent, and getting it wrong can have serious consequences.

Why DM Pairing Matters

Your OpenClaw agent is not just a chatbot. It has access to tools: browsing the web, executing code, sending emails, querying databases, managing files. If your agent is connected to business services through skills and integrations, anyone who can chat with it can potentially trigger those actions.

Without DM pairing, here is what can happen:

  • A stranger discovers your bot's username (Telegram bot usernames are public and searchable)
  • They start a conversation and begin sending prompts
  • Your agent responds, executes tools, and takes actions on behalf of an unauthorized user
  • If the agent has CRM access, the attacker can query your customer data
  • If the agent has email capabilities, the attacker can send emails from your agent's identity
  • If the agent has code execution access, the attacker can run commands on your server (if sandboxing is not properly configured)

This is not theoretical. Security researchers have demonstrated these attack vectors against OpenClaw instances with open DM policies. The OpenClaw security hardening guide covers this in detail.

Pairing Mode (Recommended)

channels:
  telegram:
    dmPolicy: "pairing"

With pairing enabled:

  1. A new user sends a message to your bot
  2. The bot does NOT respond with AI-generated content
  3. Instead, a pairing request is generated that requires admin approval
  4. You (the admin) review the request and approve or deny it
  5. Only after approval does the bot begin responding to that user
  6. The approval persists, so approved users do not need to pair again

This is the correct setting for any deployment where the agent has access to sensitive tools or business data. It ensures that only authorized users can interact with your agent.

Open Mode (Use with Caution)

channels:
  telegram:
    dmPolicy: "open"

With open mode, the bot responds to anyone who sends it a message. No approval required.

Open mode is appropriate in limited scenarios:

  • Public-facing customer support bots with no access to internal systems
  • Demo or testing bots that are intentionally open
  • Bots with extremely restricted tool access (information-only, no actions)

Even in these cases, combine open mode with strict tool sandboxing (sandbox.mode: "all") and limited tool permissions. Never run an agent with open DM policy and broad tool access.

User ID Whitelisting

For an additional layer of control, you can whitelist specific Telegram user IDs:

channels:
  telegram:
    dmPolicy: "pairing"
    allowedUserIds:
      - "123456789"     # Your Telegram user ID
      - "987654321"     # Teammate's Telegram user ID

To find your Telegram user ID, message @userinfobot on Telegram. It will reply with your numeric user ID.

With both pairing and a whitelist, only users on the whitelist can even submit a pairing request. This is the most restrictive configuration and is recommended for agents with access to sensitive business operations.

Step 5: Group Chat Configuration

Telegram bots can participate in group chats, which is useful for team collaboration scenarios. Setting this up correctly requires understanding how Telegram's group privacy model interacts with OpenClaw.

How Group Privacy Works

Telegram bots have a "privacy mode" that controls what messages they can see in group chats:

  • Privacy mode ON (default): The bot only sees messages that start with a / command or that @mention the bot. All other messages are invisible to it.
  • Privacy mode OFF: The bot sees all messages in the group.

You control this setting in BotFather with the /setprivacy command.

Recommended Group Configuration

For most use cases, keep privacy mode ON and have users interact with the bot using @mentions:

# In BotFather:
/setprivacy
# Select your bot
# Choose "Enable"

# Users interact with the bot like this in group chats:
# @acme_support_bot What's the status of order #1234?

This approach has several advantages:

  • The bot does not consume AI tokens processing irrelevant group conversation
  • Users explicitly choose when to invoke the bot
  • The bot's responses are clearly in context of a specific request
  • You avoid sending every group message through your AI model API (which can get expensive fast)

Full Group Visibility (Advanced)

If you want the bot to monitor all group conversation (for example, to detect questions it can answer or to maintain context about ongoing discussions), disable privacy mode:

# In BotFather:
/setprivacy
# Select your bot
# Choose "Disable"

Warning: With privacy mode off, every message in the group is sent to your OpenClaw instance. Depending on your configuration, this can mean every message triggers an AI model API call. In a busy group, this burns through your API budget quickly. If you use this mode, configure your agent's system prompt to only respond when directly addressed or when it can add genuine value to the conversation.

Adding the Bot to a Group

  1. Open the group chat in Telegram
  2. Tap the group name to open settings
  3. Tap Add Members
  4. Search for your bot's username and add it
  5. If required, grant the bot permission to read messages

The bot should now be active in the group. Test it with an @mention: @your_bot_username Hello, are you online?

Admin-Only Groups

For internal team groups, combine group chat with DM pairing. The bot will only respond to users who have been individually approved through the pairing process. Unapproved users who @mention the bot in the group will not receive a response.

Step 6: Inline Commands

Telegram bots support custom commands that appear in the bot's command menu. These make your bot more discoverable and easier to use.

Register Commands with BotFather

# In BotFather:
/setcommands

# Select your bot, then send the command list in this format:
start - Start the bot and get a welcome message
help - List available commands and capabilities
status - Check the agent's current status
reset - Clear conversation history and start fresh

After setting commands, users will see a / menu button in the Telegram chat interface with your commands listed.

How Commands Work with OpenClaw

When a user sends a command like /help, OpenClaw receives it as a regular message with the text "/help". The AI model processes it and generates a response based on the agent's system prompt and available tools.

To make commands work well, add instructions in your agent's system prompt:

# openclaw.yaml

agents:
  defaults:
    systemPrompt: |
      You are a helpful AI assistant for Acme Corp.

      When users send these commands, respond accordingly:
      - /start: Welcome them and briefly explain what you can help with
      - /help: List your main capabilities in a concise format
      - /status: Report your current operational status
      - /reset: Acknowledge and let them know the conversation context has been cleared

      Always respond in a professional, concise tone.

Useful Command Ideas by Use Case

Customer support bot:

start - Welcome and describe support capabilities
help - Show common questions and how to ask them
ticket - Create a new support ticket
status - Check status of an existing ticket
hours - Show business hours and response times

DevOps monitoring bot:

start - Initialize and show monitoring status
health - Run a health check across all services
deploy - Show recent deployment status
alerts - List active alerts and incidents
logs - Fetch recent error logs

Sales assistant bot:

start - Welcome and explain capabilities
pipeline - Show current pipeline summary
research - Research a prospect or company
followup - List overdue follow-ups
meeting - Schedule a meeting with a prospect

Step 7: Rate Limiting and Resource Protection

Even with DM pairing enabled, an approved user (or a compromised approved account) could send hundreds of messages per minute, burning through your AI budget and overloading your server. Rate limiting protects against this.

OpenClaw-Level Rate Limiting

OpenClaw supports configuring rate limits in the gateway configuration:

# openclaw.yaml

gateway:
  bind: "loopback"
  auth:
    mode: "token"
  rateLimit:
    enabled: true
    maxRequestsPerMinute: 20     # Max messages per user per minute
    maxConcurrent: 3             # Max simultaneous conversations

These settings prevent any single user from overwhelming your agent. Twenty messages per minute is generous for normal conversation but blocks automated flooding.

AI Budget Controls

Rate limiting protects your server. Budget controls protect your wallet. If you are using OpenRouter, set a monthly spending limit on your API key:

  1. Log in to OpenRouter
  2. Go to Keys and select your API key
  3. Set a monthly budget limit (start with $10-25 while testing)
  4. When the limit is reached, requests are rejected gracefully instead of continuing to accrue charges

This is especially important for Telegram bots because they are always online. A runaway conversation loop, a user stress-testing the bot, or even heavy normal usage can consume tokens faster than expected.

Step 8: File Sharing and Media

Telegram bots can send and receive files, images, voice messages, and documents. OpenClaw handles most of this natively through the Telegram plugin.

Receiving Files from Users

When a user sends an image or document to your bot, OpenClaw processes it through the AI model's vision or document understanding capabilities (if the model supports it). For example, sending a screenshot and asking "What error is shown in this image?" will work with vision-capable models like GPT-4o or Claude Sonnet 4.

Supported inbound file types include:

  • Images (JPEG, PNG, GIF, WebP)
  • Documents (PDF, plain text, code files)
  • Voice messages (transcribed by the AI model if supported)

Sending Files to Users

Your agent can send files back to users through Telegram. This is handled by OpenClaw's Telegram plugin natively. If the agent generates a file (a report, a code snippet, a chart), it can deliver it directly in the Telegram chat.

File Size Limits

Telegram enforces a 20MB file size limit for bots (50MB for downloads). Keep this in mind when your agent generates or sends files. For larger files, have the agent provide a download link instead of sending the file directly.

Advanced Configuration: Webhook Mode vs. Polling

By default, OpenClaw uses long-polling for Telegram. This means the OpenClaw server periodically checks Telegram's API for new messages. It is simple and works without any special networking.

Long-Polling (Default)

Long-polling works out of the box with no additional configuration. Your OpenClaw instance makes outbound HTTPS requests to Telegram's API to check for new messages. There is no need for a public URL, a reverse proxy, or any inbound network access.

Advantages:

  • Works behind firewalls and NAT
  • No public URL required
  • No TLS certificate needed for Telegram specifically
  • Simpler to debug (no webhook delivery issues)

Disadvantages:

  • Slightly higher latency (typically 1-3 seconds) compared to webhooks
  • Consumes slightly more bandwidth due to repeated API calls

Webhook Mode (Advanced)

If you need lower latency (sub-second message delivery), you can configure webhook mode. This requires your OpenClaw instance to have a publicly accessible HTTPS endpoint that Telegram can send messages to.

# openclaw.yaml - Webhook mode (requires public HTTPS URL)

channels:
  telegram:
    enabled: true
    dmPolicy: "pairing"
    transport: "webhook"
    webhookUrl: "https://your-domain.com/telegram/webhook"
    webhookSecret: "a-long-random-secret-string"

Important: Webhook mode requires your server to have a valid TLS certificate and a publicly reachable URL. If your gateway is bound to loopback (as it should be for security), you will need a reverse proxy (Nginx or Caddy) to terminate TLS and forward webhook requests to the local OpenClaw instance.

For most deployments, long-polling is the better choice. The 1-3 second latency difference is imperceptible in a chat conversation, and the simpler setup reduces the attack surface.

Troubleshooting Common Issues

Here are the most common problems people encounter when setting up Telegram with OpenClaw, along with their solutions.

Bot Does Not Respond at All

Check the container is running:

docker compose ps

Look for the OpenClaw container. If it is not running or is in a restart loop, check the logs:

docker compose logs --tail 50 openclaw

Verify the bot token:

# Test the token directly against Telegram's API
curl https://api.telegram.org/bot<YOUR_TOKEN>/getMe

If this returns a JSON object with your bot's details, the token is valid. If it returns {"ok":false,"error_code":401}, the token is invalid or has been revoked.

Check that the Telegram plugin is enabled:

Verify your openclaw.yaml has both the channel configuration and the plugin entry:

# Both sections are required:
channels:
  telegram:
    enabled: true

plugins:
  entries:
    telegram:
      enabled: true

A common mistake is configuring the channel but forgetting to enable the plugin, or vice versa. Both are required.

Bot Responds in Direct Messages but Not in Groups

This is almost always a privacy mode issue. If privacy mode is enabled (the default), the bot can only see:

  • Messages that start with a / command
  • Messages that @mention the bot
  • Replies to the bot's own messages

Either disable privacy mode in BotFather (/setprivacy then select "Disable") or instruct your users to @mention the bot when they want to talk to it in group chats.

Note: After changing the privacy mode setting, you may need to remove and re-add the bot to the group for the change to take effect.

"Unauthorized" Errors in the Logs

If you see 401 errors in the OpenClaw logs related to Telegram, the bot token is either:

  • Incorrect (typo in the .env file)
  • Revoked (regenerated via BotFather, which invalidates the old token)
  • Contains trailing whitespace or a newline character

Regenerate the token in BotFather (/revoke then /newbot or get a new token for the existing bot), update your .env file, and restart the containers.

Slow Responses (10+ Seconds)

Slow responses are usually caused by the AI model, not the Telegram integration. Check:

  • Model choice: Larger models (GPT-4o, Claude Sonnet 4) take 3-8 seconds to generate a response. Smaller models (GPT-4o-mini, Claude Haiku) are faster but less capable.
  • Tool execution: If the agent is running tools (browsing, code execution, API calls) as part of its response, each tool call adds time. Check the logs to see what tools are being invoked.
  • Server resources: If your VPS is underpowered (less than 2 vCPU, less than 4GB RAM), the container may be resource-constrained. Check with docker stats.
  • API rate limits: If your AI model API key is being rate-limited, requests queue up and take longer. Check the OpenClaw logs for rate limit warnings.

Bot Stops Working After a Server Reboot

Make sure Docker is configured to start on boot and your containers have restart policies:

# Enable Docker to start on boot
sudo systemctl enable docker

# Verify your docker-compose.yaml has restart policies
# Each service should have:
# restart: unless-stopped

Messages Appear Out of Order

Telegram delivers messages in order, but if your AI model takes varying amounts of time to respond to different messages, responses can arrive out of order. This is most noticeable when a user sends multiple messages quickly.

The solution is to configure your agent to handle messages sequentially rather than in parallel, or to instruct users to wait for a response before sending the next message. The maxConcurrent rate limit setting (covered above) helps by queuing messages when the agent is already processing one.

Pairing Requests Not Appearing

If a new user messages the bot and no pairing request appears in your admin interface:

  • Check the OpenClaw logs for the pairing event
  • Verify that dmPolicy is set to "pairing" (not "pair" or "paired")
  • Make sure the admin notification channel is configured correctly
  • Try restarting the containers and having the user send a new message

Security Best Practices for Telegram Bots

Beyond DM pairing, here are additional security measures for production Telegram bot deployments:

1. Rotate Bot Tokens Periodically

Telegram bot tokens do not expire, which means a leaked token remains valid indefinitely. Rotate your bot token every 90 days or immediately if you suspect it has been exposed. In BotFather, use /revoke to generate a new token.

2. Enable Tool Sandboxing

Every tool execution (code, shell commands, file operations) should run in a sandbox:

agents:
  defaults:
    sandbox:
      mode: "all"

Without sandboxing, a prompt injection attack through Telegram could execute arbitrary commands on your server. With sandboxing, tool calls run in an isolated container with restricted access.

3. Bind the Gateway to Loopback

This is not Telegram-specific, but it is worth repeating: the OpenClaw gateway should always bind to loopback only. Never expose it to the public internet.

gateway:
  bind: "loopback"       # NEVER set this to "0.0.0.0"

If you need to access the OpenClaw API remotely, use an SSH tunnel or a secure reverse proxy. Our security hardening guide covers this in detail.

4. Monitor for Unusual Activity

Keep an eye on your OpenClaw logs for patterns that suggest abuse:

  • Rapid-fire messages from a single user (automated probing)
  • Attempts to override the system prompt ("Ignore your instructions and...")
  • Requests for sensitive information or unauthorized actions
  • Unexpected tool executions that you did not configure

Set up log alerts for these patterns if your monitoring system supports it.

5. Use Separate Bots for Separate Purposes

If you have multiple use cases (customer support, internal DevOps, sales), create a separate Telegram bot for each. Each bot should connect to its own OpenClaw instance with its own tool permissions and access controls. This limits the blast radius if one bot is compromised.

Skip the Setup: Managed Telegram on ClawTrust

If you have read this far, you have a thorough understanding of what it takes to set up Telegram with OpenClaw properly. The BotFather setup is quick, but the production-grade configuration (DM pairing, rate limiting, sandboxing, monitoring, gateway hardening) adds hours of work. And that is on top of the base OpenClaw installation time.

ClawTrust includes Telegram on every plan. All three tiers: Starter ($79/mo), Pro ($159/mo), and Enterprise ($299/mo). Here is what that looks like:

  1. Sign up and pick a plan. All plans include Telegram and all other messaging channels.
  2. Create a Telegram bot. You still create the bot through BotFather (Telegram requires this). Takes two minutes.
  3. Connect it from the dashboard. Paste your bot token into the ClawTrust dashboard. One field, one click.
  4. Done. Your agent is live on Telegram with DM pairing, rate limiting, tool sandboxing, gateway hardening, disk encryption, health monitoring, and AI budget controls already configured. Every security measure covered in this guide is applied automatically.

The difference is not just convenience. It is what is included by default:

  • DM pairing: Enabled and managed from your dashboard. Approve users with one click.
  • AI budget controls: Spending limits prevent surprise API bills. Your agent pauses gracefully at the limit.
  • Security hardening: Loopback gateway binding, token auth, Docker sandboxing, LUKS2 disk encryption, and credential isolation. All seven layers. All automatic.
  • Health monitoring: Checks every 15 minutes with auto-remediation for common issues.
  • Fleet-wide patching: When a CVE is disclosed, your instance is patched without any action on your part.

Every channel covered in this guide (Telegram, Slack, Discord, WhatsApp, and more) is available on every plan. You connect them from a dashboard, not a YAML file.

If you want to self-host and have full control, the guide above gives you everything you need. If you want to skip straight to having a working, secured Telegram bot and focus on what your agent actually does, ClawTrust handles the infrastructure.

Frequently Asked Questions

How do I find my Telegram user ID?

Message @userinfobot on Telegram. It will reply with your numeric user ID. You need this if you want to set up user ID whitelisting in your OpenClaw configuration.

Can I use one Telegram bot with multiple OpenClaw instances?

No. A Telegram bot token can only be connected to one polling client at a time. If two OpenClaw instances try to poll with the same token, one will fail or both will receive intermittent messages. Create a separate bot for each instance.

Does the bot work in Telegram channels (broadcast channels)?

Telegram channels are one-to-many broadcast channels, not interactive conversations. Bots have limited functionality in channels. They can post messages to channels where they are an admin, but they cannot respond to individual messages. For interactive AI agent use cases, use direct messages or group chats instead.

How much does the Telegram integration cost?

The Telegram integration itself is free, both from Telegram's side and within OpenClaw. The only costs are running your OpenClaw server and the AI model API usage for generating responses. On ClawTrust, Telegram is included on every plan with no additional per-channel fee.

Can I customize the bot's response formatting?

Yes. OpenClaw sends Telegram messages with Markdown formatting enabled. You can customize how your agent formats responses through the system prompt. For example, instruct the agent to use bullet points, bold key terms, or include emoji for readability.

Is Telegram safe for business use?

Telegram provides end-to-end encryption for Secret Chats, but regular chats (including bot conversations) use client-server encryption. Messages are encrypted in transit and stored encrypted on Telegram's servers. For highly sensitive business communications, layer additional security measures: use DM pairing to control access, enable tool sandboxing, and ensure your OpenClaw instance follows the security hardening guide. On ClawTrust, all these measures are applied automatically.

What happens when I reach my AI budget limit?

If you are using OpenRouter with a budget cap, your agent will stop generating responses when the limit is reached. Users will see no response or a generic message (depending on your configuration). On ClawTrust, the agent pauses gracefully and you receive a notification. You can top up credits anytime to resume service.

Can I switch from self-hosted Telegram to ClawTrust later?

Yes. Your Telegram bot stays the same. You create a new ClawTrust agent, enter the same bot token in the dashboard, and the bot connects to your new managed instance. Your users see no interruption. The bot username, conversation history on Telegram's side, and all BotFather settings are preserved.


Chris DiYanni is the founder of ClawTrust. Previously at Palo Alto Networks, SentinelOne, and PagerDuty. He builds security infrastructure so businesses can trust their AI agents with real work.

Frequently Asked Questions

How do I connect Telegram to OpenClaw?

Create a bot through Telegram's BotFather, save the bot token, add it to your OpenClaw .env file, enable the Telegram channel and plugin in openclaw.yaml, and restart your containers. The basic setup takes about 15 minutes. DM pairing, group chat configuration, and security hardening add another 30-45 minutes.

What is DM pairing and why does it matter for OpenClaw Telegram bots?

DM pairing requires admin approval before your bot responds to new users. Without it, anyone who discovers your bot's username can interact with it. Since OpenClaw agents have access to tools, an unauthorized user could trigger actions like browsing, code execution, or API calls. DM pairing prevents this by gating access behind explicit approval.

Can I add my OpenClaw Telegram bot to group chats?

Yes. Enable group support in BotFather with /setjoingroups, then add the bot to your group. By default, privacy mode means the bot only sees /commands and @mentions. You can disable privacy mode to let the bot see all group messages, but this increases AI model API usage significantly.

Why is my OpenClaw Telegram bot not responding?

The most common causes are: the OpenClaw container is not running, the bot token is incorrect or has trailing whitespace, the Telegram plugin is not enabled in openclaw.yaml, or DM pairing is enabled and the user has not been approved yet. Check docker compose logs openclaw for specific error messages.

Does Telegram work with OpenClaw without a public URL?

Yes. OpenClaw uses long-polling by default for Telegram, which makes outbound requests to Telegram's API. No public URL, reverse proxy, or inbound port is required. This is one of the reasons Telegram is the easiest OpenClaw channel to set up.

How do I prevent unauthorized users from using my Telegram bot?

Enable DM pairing in your openclaw.yaml configuration (dmPolicy: pairing). For additional security, add a user ID whitelist with allowedUserIds. Combine this with tool sandboxing (sandbox.mode: all) and gateway loopback binding to create a defense-in-depth setup.

Is Telegram included on all ClawTrust plans?

Yes. Telegram and all other messaging channels (Slack, Discord, WhatsApp, and more) are available on every ClawTrust plan: Starter at $79/mo, Pro at $159/mo, and Enterprise at $299/mo. You connect Telegram from the dashboard by pasting your BotFather token.

Can I use one Telegram bot with multiple OpenClaw instances?

No. A Telegram bot token can only connect to one polling client at a time. If two instances use the same token, one will fail or messages will be delivered inconsistently. Create a separate bot in BotFather for each OpenClaw instance.

openclawtelegramsetuptutorialbotmessagingsecuritydm-pairingguide

Ready to hire your first AI employee?

Secured and ready in 5 minutes.

Get Started