OpenClaw Telegram does not use a separate
login command. You configure the bot token in config or env, then start the gateway.1. Create the Bot
In Telegram:- Open
@BotFather. - Run
/newbot. - Pick a display name and username.
- Copy the bot token.
2. Add the Telegram Config
For a DM-first sandbox test, use pairing for DMs and disable groups at first:dmPolicy: "pairing"gives you the shortest first test pathgroupPolicy: "disabled"removes the noisy doctor warning about empty group allowlistsstreaming: "off"keeps Telegram replies simple and final-only during setup
3. Start the Gateway
In the sandbox container, you do not need to fix background service mode first. This warning is expected:- the gateway keeps running in the background
- you can keep using the same terminal for the next setup commands
- logs are written to
~/.openclaw/logs/gateway-sandbox.log
RPC probe: ok- a log line showing Telegram started successfully
4. Pair the First DM
Telegram bots cannot message you first. Open the bot chat:- Tap
Start - Send
hello
openclaw gateway, leave that running and open a second terminal for the pairing commands.
If you started the gateway with the detached nohup ... & command above, you can run the pairing commands in the same terminal:
OpenClaw channel auth and model auth are separate. If Telegram connects but the bot does not produce real replies, finish the model-auth step next.
5. Safer Owner-Only DM Setup
After the first test works, you can switch from pairing to an explicit allowlist. Find your Telegram user ID:- DM the bot
- Run
openclaw logs --follow - Read
from.id
6. Group Setup Later
Only do this after DMs work. If you want group support:/setjoingroups/setprivacy
Troubleshooting
openclaw gateway restartsays the gateway service is disabled: That is expected in the sandbox container. Useopenclaw gatewayin the foreground instead.- Telegram config is saved but no replies arrive: Make sure the gateway process is actually running and that you approved the pairing code.
- Group warnings mention empty allowlists:
For DM-first setup, set
channels.telegram.groupPolicyto"disabled". - The bot exists but you cannot message it:
Open the direct
https://t.me/<bot_username>link and tapStart.