Cue and OpenClaw use separate Telegram config files. Cue reads
~/.cue/config.json or ~/.cue/agents/<agent>/agent.json. OpenClaw uses ~/.openclaw/.Before You Start
- You need a Telegram account and access to
@BotFather. - Cue Telegram runtime currently runs in the background worker for the target agent.
- For first-time setup, start with DMs. Group setup is possible, but DM validation is shorter and easier to debug.
Fastest Setup
Replace<agent> with the agent you actually run.
If you already use a local dev agent such as main-localhost, use that same agent here.
telegram statusshowsenabled: truechannel statusshows Telegramrunning: true
Step 1: Create the Bot
In Telegram:- Open
@BotFather. - Run
/newbot. - Pick a display name and username.
- Copy the bot token.
Step 2: Configure Cue
The command above is the recommended setup path because it:- validates the bot token with Telegram
- writes agent-scoped config
- stores the env var name, not the raw token
Non-Interactive CLI
Fastest first test:Equivalent agent.json
If you prefer to inspect or edit the config directly, Cue writes agent-scoped config into ~/.cue/agents/<agent>/agent.json.
Open DM test setup:
enabled: true alone is not enough. dm.policy and group.policy default to disabled unless you set them.
Step 3: Send the First DM
Telegram bots cannot message you first. You must open the bot chat yourself:- Tap
Start - Send
hello
t.me link is the reliable path.
Step 4: Validate the Runtime
Use these checks:- Send one DM to the bot first.
- Read the chat id from Telegram:
- Look for
message.chat.id, then send a test message:
Group Setup
Start with DMs first. When that works:- Add the bot to a Telegram group
- Enable group policy
- Restart the worker
- mentioning the bot with
@botusername, or - replying to one of the bot’s messages
Troubleshooting
channel statussays the worker is unavailable: Runcue --agent <agent> client restart --json. If it still fails, checkcue --agent <agent> auth --json. Backend-connected agents need valid auth before the channel runtime can start.telegram statuslooks right butchannel statusis not running: The config is saved, but the background worker has not restarted with it yet.channel statusbriefly showsruntime_not_initializedright after restart: Wait a moment and runcue --agent <agent> channel status --provider telegram --jsonagain. The worker may still be starting the provider runtime.- Bot exists but you cannot message it:
Open the direct
https://t.me/<bot_username>link and tapStart. - Another tool already uses the same token: Telegram long polling and webhooks cannot both own the same bot token at the same time. Use one consumer only.
- DMs work but groups do not:
Check
group.policyand make sure you mentioned the bot or replied to a bot message.