← All articles

How to Connect OpenClaw with Telegram from the CLI

Add the Telegram bot token from the shell, probe the channel, and use logs to read sender IDs before you build allowlists.

If you want a terminal-first Telegram setup, keep the whole flow in the CLI: add the bot, probe the channel, inspect logs for IDs, then decide whether you want pairing or an explicit allowlist.

Quick answer

Use openclaw channels add --channel telegram --token ..., then verify with openclaw channels status --probe and openclaw logs --follow.

Command line steps

1. Add the Telegram bot token

This is the cleanest CLI-only way to attach Telegram.

openclaw channels add --channel telegram --token "$TELEGRAM_BOT_TOKEN"

2. Probe the channel and follow the logs

Logs are the fastest way to confirm that Telegram traffic is reaching the gateway.

openclaw channels status --probe
openclaw logs --follow

3. Read your Telegram user ID before you build allowlists

Use the live logs or the Bot API to avoid guessing.

curl "https://api.telegram.org/bot$TELEGRAM_BOT_TOKEN/getUpdates"

What to check if it still fails

  • If you prefer not to rely on pairing, move to allowFrom once you know your numeric Telegram ID.
  • If the bot sees DMs but not groups, revisit privacy mode or admin permissions in Telegram itself.
  • If the probe passes but replies still fail, the problem is probably the model layer, not Telegram.
FAQ

Frequently asked questions

What will I learn from How to Connect OpenClaw with Telegram from the CLI?

Add the Telegram bot token from the shell, probe the channel, and use logs to read sender IDs before you build allowlists. The guidance is written for practical self-hosted OpenClaw environments, but commands and configuration can change between releases.

Should I back up OpenClaw before changing the configuration?

Yes. Back up the active configuration, credentials references, channel settings, and service definitions before repairs, upgrades, or model changes, then validate the gateway and important workflows after the change.

Can Milan help with OpenClaw setup or troubleshooting?

Yes. Milan provides OpenClaw setup, model and channel configuration, secure remote access, workflow automation, troubleshooting, and deployment support.

Need help with OpenClaw setup?

Turn the idea into a working system.