- Authors

- Name
- Jerry Smith
TLDR
OpenClaw Telegram agents fail for a few common reasons. 401 errors mean your bot token is wrong or expired. allowFrom issues happen when you mix up usernames and user IDs. Your agent stays silent in groups when pairing is not approved or requireMention is misconfigured. This guide walks through each problem with actual fix commands.
Overview
When you connect your OpenClaw agent to Telegram, the agent should respond immediately. But sometimes it crashes with 401 errors, stays silent in groups, or ignores specific users. This happens because Telegram authentication is strict and OpenClaw's security model requires explicit pairing approval. This guide covers the five most common Telegram errors your agent encounters, why they happen, and how to fix them with copy-paste terminal commands. By the end, your agent will be responding reliably.
401 unauthorized: your bot token is wrong
I see this error more than any other when people set up OpenClaw with Telegram. The logs show 401 Unauthorized and the bot never connects.
Why it happens
The 401 error means Telegram rejected your authentication. Three causes:
- Token is typed wrong. Extra space, missing character, wrong environment variable.
- Token was revoked. You regenerated it in BotFather and forgot to update config.
- Token is for the wrong bot. You have multiple bots and copied the wrong token.
How to fix it
Stop the gateway first:
openclaw gateway stop
Go to @BotFather in Telegram and send /mybots. Select your bot, then click "API Token". Copy the full token shown.
Now update your config. If you use environment variables:
export TELEGRAM_BOT_TOKEN="7234567890:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw"
Or edit your config file directly at ~/.openclaw/config/config.json:
{
"channels": {
"telegram": {
"enabled": true,
"accounts": {
"default": {
"token": "7234567890:AAHdqTcvCH1vGWJxfSeofSAs0K5PALDsaw"
}
}
}
}
}
Restart the gateway:
openclaw gateway restart
Check the logs:
openclaw logs --follow
Look for Telegram channel started or Connected as @YourBotName. If you still see 401, the token is still wrong. Go back to BotFather and verify you copied the entire token.
Token got revoked
If your bot worked before and suddenly shows 401, someone (maybe you) revoked the token in BotFather. This happens when you click "Revoke current token" by accident or when troubleshooting other issues.
Generate a new token in BotFather and update your config again. The old token is permanently dead.
allowFrom configuration: username vs user ID
The allowFrom setting controls who can talk to your bot. I spent an hour debugging this once because I used a username instead of a user ID.
The problem
Telegram has two identifiers:
- Username:
@jerry(optional, user can change it) - User ID:
123456789(permanent, never changes)
OpenClaw's allowFrom expects user IDs, not usernames. If you put @jerry in the config, the bot ignores you.
How to get your user ID
Send /start to @userinfobot on Telegram. It replies with your user ID immediately.
Or check the OpenClaw logs when you send a message. The logs show:
Received message from user 123456789 (@jerry)
That number is your user ID.
Fix your config
Edit ~/.openclaw/config/config.json:
{
"channels": {
"telegram": {
"accounts": {
"default": {
"token": "your_token_here",
"allowFrom": ["123456789", "987654321"]
}
}
}
}
}
Use the numeric IDs, not the @ usernames. Restart the gateway after saving:
openclaw gateway restart
Adding new users
When you add someone to allowFrom, use their user ID. Ask them to message @userinfobot and send you the number.
Then add it to the array:
"allowFrom": ["123456789", "987654321", "555666777"]
Restart the gateway. The new user can now interact with your bot.
Bot not responding in groups
Your bot joined the group but stays completely silent. This is usually a pairing or mention issue.
Pairing not approved
OpenClaw requires explicit approval before your agent responds in a Telegram group. This is a security feature to prevent random people from controlling your agent.
When you add the bot to a group, OpenClaw logs a pairing request:
Pairing request from group -1001234567890 (My Group Chat)
You need to approve it. Send this command from your terminal:
openclaw pairing approve telegram -1001234567890
The negative number is the group's chat ID. Copy it exactly from the logs.
After approving, the bot responds to messages in that group. Check approved pairings anytime:
openclaw pairing list
Mention required
By default, your agent in groups only responds when mentioned. This prevents it from replying to every message in busy groups.
To trigger the bot, mention it by username:
@YourBotName what is the weather today
Or reply directly to one of its messages.
If you want the bot to respond to all messages (not recommended for busy groups), disable requireMention:
{
"channels": {
"telegram": {
"accounts": {
"default": {
"requireMention": false
}
}
}
}
}
Restart the gateway after changing this.
Group privacy mode
Telegram bots have a "Privacy Mode" setting in BotFather. When enabled, bots only see messages that mention them or are replies.
To change it:
- Go to @BotFather
- Send
/mybots - Select your bot
- Click "Bot Settings" then "Group Privacy"
- Choose "Turn off" to let the bot see all messages
This does not bypass OpenClaw's requireMention setting. Both must be configured.
Group ID issues: wrong chat ID format
Group chat IDs in Telegram are confusing. They look like negative numbers and change format depending on the group type.
Supergroups vs regular groups
Regular groups have IDs like -123456789. When you upgrade a group to a supergroup, the ID changes to -1001234567890 (adds 100 after the minus sign).
If your bot worked in a group and then stopped after an upgrade, the chat ID changed. Check the logs for the new pairing request and approve the new ID.
Finding the group ID
Send a message in the group and check OpenClaw logs:
openclaw logs --follow
Look for:
Received message in chat -1001234567890
That is your group ID. Use it exactly as shown (including the minus sign) when approving pairing.
Or add the bot to the group and check for the pairing request line. The ID is there.
Common mistakes
Do not remove the minus sign. -1001234567890 is not the same as 1001234567890. Telegram needs the negative number.
Do not use the group username or invite link. OpenClaw needs the numeric chat ID.
Pairing request and pending approval errors
You see "pairing pending" or "not paired" errors when the bot refuses to respond.
What this means
OpenClaw tracks every chat and requires approval before interacting. This applies to:
- Direct messages (DMs)
- Group chats
- Channels (if your bot is an admin)
The first time someone messages the bot or adds it to a group, OpenClaw creates a pending pairing request.
How to approve
List pending requests:
openclaw pairing pending
You see output like:
Pending pairings:
- telegram:-1001234567890 (Group: Project Team)
- telegram:987654321 (User: @alice)
Approve each one:
openclaw pairing approve telegram -1001234567890
openclaw pairing approve telegram 987654321
After approval, the bot responds immediately.
Auto-approve for trusted users
If you are the only user and want to skip manual approval, add yourself to allowFrom and set autoApprove:
{
"channels": {
"telegram": {
"accounts": {
"default": {
"allowFrom": ["123456789"],
"autoApprove": true
}
}
}
}
}
Now the bot auto-approves pairing requests from your user ID. Use this carefully. Do not enable it for bots in public groups.
Reject unwanted pairings
To reject a pairing request:
openclaw pairing reject telegram -1001234567890
The bot ignores all messages from that chat going forward.
FAQ
Why does my bot work in DMs but not in groups?
You approved the DM pairing but not the group pairing. Each chat requires separate approval. Check openclaw pairing pending for unapproved group pairings.
Can I use the same bot in multiple OpenClaw instances?
No. Telegram bots can only connect to one instance at a time. If you start a second gateway with the same token, it kicks the first one offline. Use separate bots for separate instances.
The bot replies but says "not authorized" for certain commands. Why?
Your user ID is not in the allowFrom list. Get your user ID from @userinfobot and add it to the config. Commands are restricted to authorized users only.
I deleted and recreated my bot in BotFather. Now nothing works.
Deleting a bot invalidates the token permanently. You need to create a new bot (with a new username), get the new token, and update your OpenClaw config. Old tokens cannot be recovered.
How do I remove an approved pairing?
There is no built-in unpair command yet. Edit ~/.openclaw/data/pairings.json directly and remove the entry for that chat ID. Or reject it if it sends a new message.
Conclusion
Most Telegram errors in OpenClaw come down to three things: wrong tokens, user IDs vs usernames, and unapproved pairings. When you see 401, regenerate your token in BotFather and update the config. When allowFrom does not work, switch to numeric user IDs. When the bot is silent in groups, approve the pairing request.
For more on setting up OpenClaw with Telegram, check out the complete Telegram setup guide and using Telegram groups with OpenClaw. If you are running OpenClaw on a VPS, the DigitalOcean VPS setup guide covers remote deployment.
The official OpenClaw Telegram docs have full config reference and examples.
Enjoyed this post?
Get new articles delivered to your inbox. No spam, unsubscribe anytime.
Related Posts
Feb 14, 2026
Solved: OpenClaw Discord 4014 and intent errors
Fix OpenClaw Discord agent errors fast: 4014 intent issues, missing permissions, silent bot problems, requireMention config, guild allowlists.
Feb 6, 2026
6 Telegram Groups That Organized My OpenClaw Agent (Here's How)
Organize your OpenClaw projects using Telegram groups. Create groups, get their IDs, and your agent handles the rest. See project status at a glance.
Feb 15, 2026
Proven fixes: 7 OpenClaw install and gateway errors
Fix OpenClaw agent install errors: npm failures, gateway crashes, Node version issues, port conflicts, and post-upgrade config problems now.

Comments