How to Connect OpenClaw to Telegram (Step-by-Step Guide)
Tutorials

How to Connect OpenClaw to Telegram (Step-by-Step Guide)

I've spent way too many hours trying to connect OpenClaw to Telegram. Here's the thing - the official docs have all the information, but they scatter it across different pages and assume you already know the terminology. When I finally got it working, I realized the process is actually simple once you understand what each step does.

This guide is for people like me - AI enthusiasts who want their own AI assistant accessible from Telegram. No fluff, just the exact steps that work.

What Is OpenClaw Telegram Integration?

OpenClaw is an AI agent framework that can connect to different messaging platforms. When you integrate it with Telegram, you get a bot that responds to your messages using AI - the same way you'd chat with Claude or ChatGPT, but through Telegram.

The connection works through Telegram's Bot API. You create a bot through BotFather, give OpenClaw the bot token, and then pair your Telegram account. Once connected, you can control your AI agent from anywhere using just your phone.

What You Can Do with OpenClaw Telegram Bot?

Once connected, your Telegram bot becomes a gateway to your AI assistant. You can ask it to run research, draft content, analyze data, or execute tasks - all from Telegram's chat interface.

Beyond simple conversations, you can invite the bot to group chats for team collaboration, create custom slash commands for frequently used workflows, and even run your own AI-powered news channels. Some users have built multi-agent setups where different topics route to different AI personalities.

The real power shows up when you combine it with OpenClaw's skills system. Your Telegram bot can pull data, generate reports, create images, or integrate with other services - all triggered by simple messages.

Requirements for Connecting OpenClaw to Telegram

Before starting, make sure you have these ready:

Software Requirements

  • OpenClaw installed and running (version 5.0 or higher works best)
  • Node.js 22 or higher (some hosts have IPv6 issues with older versions)
  • Access to your OpenClaw configuration file

Account Requirements

  • A Telegram account (obviously)
  • Permission to create bots (BotFather is open to everyone)

For Cloud Deployment

  • A VPS or server where OpenClaw is running
  • SSH access to that server
  • Outbound HTTPS access to api.telegram.org (port 443)

For Local Deployment

  • Stable internet connection (Telegram needs to reach your machine)
  • Optional: ngrok or similar for tunneling if behind NAT

The setup process is the same whether you're on Windows, Mac, or Linux. The commands are identical.

How to Connect OpenClaw to Telegram (Step-by-Step)

Here's the exact process that works, from start to finish.

Step 1: Create Your Telegram Bot

Open Telegram and search for @BotFather - make sure it has the blue verification checkmark. Send the message /newbot to start creating a new bot.

BotFather will ask you for a bot name. This is the display name users see, so something like "My AI Assistant" works fine. Next, it asks for a username - this must end in "bot" (like my_assistant_bot).

Once created, BotFather shows you a token that looks like:

123456789:ABCdefGHIjklMNOpqrsTUVwxyz123456

Copy this token now. You can't retrieve it later without regenerating, which invalidates the old one.

Step 2: Add the Token to Your OpenClaw Config

Open your OpenClaw configuration file. On most systems, this is at ~/.openclaw/openclaw.json. On VPS deployments, you might need SSH access first.

Add the Telegram channel configuration to the channels section:

{ "channels": { "telegram": { "enabled": true, "botToken": "YOUR_TOKEN_HERE", "dmPolicy": "pairing" } } }

If you already have a channels section, just add the telegram object inside it.

Save the file and restart the gateway:

openclaw gateway restart

Step 3: Pair Your Telegram Account

Here's where most people get stuck. The dmPolicy: "pairing" setting means your bot won't respond to just anyone - it needs explicit approval first.

Open Telegram and find your bot (search by the username you created). Send /start.

The bot responds with a message that includes your Telegram user ID and a pairing code. It looks like this:

Your Telegram user id: 123456789 Pairing code: ABCD1234

Now go to your OpenClaw terminal and approve the pairing:

openclaw pairing approve telegram ABCD1234

You'll see a confirmation message. If you don't approve within one hour, the pairing code expires and you'll need to start over.

Step 4: Verify the Connection Works

Send a test message to your bot - something simple like "hello" or "status". The bot should respond.

If it responds, congratulations - you're connected. If not, check the next section for troubleshooting.

Common Issues: Why OpenClaw Telegram Is Not Working?

I've hit every one of these issues myself. Here's how to fix them.

Issue 1: Bot Responds with "Access Not Configured"

This is the most common error I see in forums. It means your Telegram account passed authentication (OpenClaw knows who you are) but failed authorization (OpenClaw hasn't decided if you're allowed to use it).

The fix depends on your dmPolicy setting. If you're using "pairing", make sure you approved the pairing code. If you're using "allowlist", make sure your numeric user ID is in the allowFrom list.

!
Important
Use numeric IDs, not @usernames. Putting "@yournickname" in allowFrom causes silent failures. Use the number like "123456789" instead.

Issue 2: Bot Works in DMs But Not Groups

This confused me at first. Here's why: pairing is DM-only. Groups have completely separate access controls.

To fix group access, add your group to the config:

{ "channels": { "telegram": { "groups": { "-1001234567890": { "requireMention": true, "groupPolicy": "open" } } } } }

The group ID starts with "-100" for supergroups. You can find it in your OpenClaw logs when someone messages the group.

Issue 3: 401 Unauthorized Error

Your bot token is wrong. This happens when you:

  • Copied the token incorrectly (extra spaces are common)
  • Regenerated the token in BotFather but forgot to update the config)
  • Have multiple bots and grabbed the wrong token

Go back to BotFather, get a fresh token, update your config, and restart the gateway.

Issue 4: Bot Not Responding to Group Messages

Check three things in this order:

First: Does the bot need to be mentioned? Try @YourBotName hello instead of just "hello". If this works, you can disable requireMention in your config.

Second: Check privacy mode. Go to BotFather, send /mybots, select your bot, then Bot Settings > Group Privacy > Turn off. After changing this, you must remove the bot from the group and re-add it for Telegram to apply the new setting.

Third: Check your group configuration. If groupPolicy is "allowlist", you need to add user IDs to the group's allowFrom list.

Issue 5: Bot Randomly Stops Responding

Run the diagnostic commands:

openclaw status openclaw gateway status openclaw logs --follow

Look for Telegram channel started in the logs. If you see connection errors, check if api.telegram.org is reachable from your server.

If messages are being "dropped", check the reason - it might say "pairing required" or "not in allowlist". Each tells you exactly what's wrong.

Issue 6: After an Update, Allowlist Blocks You

I learned this the hard way. After upgrading OpenClaw, some versions started requiring numeric IDs instead of usernames in allowFrom. If your config has "@yournickname", it simply stops working.

The fix: run openclaw doctor --fix to audit your configuration, or manually replace @usernames with numeric IDs.

Easier Alternative: Deploy OpenClaw in Minutes

If the command-line setup feels overwhelming, there's a faster way to get started. Nut Studio lets you deploy OpenClaw with just one click---no need to install dependencies, manage environments, or edit configuration files manually.

🚀 Nut Studio makes OpenClaw easy to deploy

Nut Studio lets you run OpenClaw with one click, no setup or coding required. Log in to enjoy 30 free points!

Free Download

With a guided setup interface, you can quickly connect your services, configure your bot, and get everything running in a clear, structured workflow. Instead of dealing with complex setup steps, you simply follow the on-screen instructions and complete the process in minutes.

This makes Nut Studio especially useful for anyone who wants to focus on building and using their AI agent, rather than spending time on setup and troubleshooting. You still get a fully functional OpenClaw environment---just with a much faster and smoother experience.

Deployment Speed
5 Seconds
Average Deployment Time
Availability
99.9%
Service Availability Guarantee
Support Team
24/7
Round-the-Clock Technical Support

FAQs

How long does the pairing code last?

One hour. If it expires, message the bot again to get a new code.

Can I use the same bot token for multiple OpenClaw instances?

No. Telegram only allows one active connection per token. Running two instances with the same token causes conflicts.

What's the difference between dmPolicy "pairing" and "allowlist"?

Pairing requires you to approve each user through a code. Allowlist gives access to anyone whose numeric user ID is in the list. Pairing is better for personal bots; allowlist is better when you know exactly who should have access.

Can I add multiple users to my bot?

Yes. With dmPolicy "allowlist", add multiple numeric IDs to allowFrom. With dmPolicy "pairing", each user needs to go through the approval process.

Why does my bot need privacy mode disabled for groups?

Telegram bots default to privacy mode, which means they can only see messages directed at them. For group bots to work properly, you need to either disable privacy mode or make the bot an admin.

Conclusion

Connecting OpenClaw to Telegram is straightforward once you understand the pieces: create a bot, add the token, approve your account, and test. The official docs have all the details, but they assume knowledge that takes time to build.

If you run into issues, the most likely culprits are: wrong bot token (401 errors), numeric ID confusion in allowFrom (access denied), and privacy mode blocking group messages.

For a faster setup without the technical overhead, Nut Studio handles the integration automatically. For full control, the step-by-step process above has everything you need.

Your AI assistant in Telegram - it's worth getting it working.

Contents