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

  1. Open Telegram and start a chat with @BotFather.
  2. Send /newbot.
  3. Choose a display name, for example Mona.
  4. Choose a username that ends in bot, for example mona_assistant_bot.
  5. 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 set
Telegram 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.

  1. In Telegram, open your bot (search for its username) and send it any message.

  2. The bot replies with a pairing code.

  3. On your computer, list the pending requests:

    officeclaws telegram pairings
    CODE      USERNAME  USER-ID     EXPIRES
    K7Q2XM    alex      123456789   2026-10-17T12:30:00Z
    
  4. Approve the request:

    officeclaws telegram approve K7Q2XM
  5. 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
ModeWho can message the agent
pairing (default, recommended)Only people you approve with a pairing code
allowlistOnly accounts on the agent's allowlist
openAnyone who finds the bot. Not recommended. They would use your ChatGPT limits.
disabledNobody. The bot ignores direct messages.

Other commands

officeclaws telegram show      # current settings (token masked)
officeclaws telegram disable   # turn Telegram off

Next step

Schedule tasks →