Connect Telegram
Create a Telegram bot for your agent and chat with it from your phone.
Once Telegram is connected, you can message your agent from your phone, wherever you are. It also lets scheduled tasks send their results to you.
Step 1: Create a bot
- Open Telegram and start a chat with @BotFather.
- Send
/newbot. - Choose a display name, for example
Mona. - Choose a username that ends in
bot, for examplemona_assistant_bot. - BotFather replies with a token that looks like
123456789:AAH.... Copy it.
Keep the token secret. Anyone who has it can control your bot.
Step 2: Connect the bot to your agent
officeclaws telegram setTelegram bot token: 123456789:AAH...
Telegram channel configured.
To apply the new setting, telegram set restarts the agent's container, so the agent is unavailable for a few seconds. If you run telegram set again without --dm-policy, the mode goes back to pairing.
Step 3: Pair your Telegram account
By default, the bot only talks to people you approve. This mode is called pairing.
-
In Telegram, open your bot (search for its username) and send it any message.
-
The bot replies with a pairing code.
-
On your computer, list the pending requests:
officeclaws telegram pairingsCODE USERNAME USER-ID EXPIRES K7Q2XM alex 123456789 2026-10-17T12:30:00Z -
Approve the request:
officeclaws telegram approve K7Q2XM -
Message the bot again. Now the agent answers.
Save your USER-ID. You'll need it to send scheduled task results to Telegram.
Who can message the bot
Choose a mode with --dm-policy:
officeclaws telegram set --dm-policy pairing| Mode | Who can message the agent |
|---|---|
pairing (default, recommended) | Only people you approve with a pairing code |
allowlist | Only accounts on the agent's allowlist |
open | Anyone who finds the bot. Not recommended. They would use your ChatGPT limits. |
disabled | Nobody. The bot ignores direct messages. |
Other commands
officeclaws telegram show # current settings (token masked)
officeclaws telegram disable # turn Telegram off