Skip to content

Telegram bot

The Telegram bot is a peer. It registers as telegram. Notifications agents send to it appear in your Telegram chat; messages you send route back into the mesh as tracked asks by default.

Setup

TELEGRAM_BOT_TOKEN=... TELEGRAM_CHAT_ID=... repowire telegram start

Tokens can also live in ~/.repowire/config.yaml:

telegram:
  bot_token: "..."
  chat_id: "..."

repowire setup writes those keys after the interactive prompt for Telegram credentials. The bot can run on any machine reachable from the daemon; many people run it on the same box.

Commands

Command What it does
/peers (or /start, /list) Show online peers as inline buttons; tap to pick a target
/select <peer> Sticky-route subsequent messages to that peer until /clear
/switch <peer> Alias for /select
/clear Clear the sticky target
@peer message Open an ask to a specific peer (also updates sticky)
/notify [@peer] message Fire-and-forget notification/FYI; uses sticky target if @peer is omitted
/fyi [@peer] message Alias for /notify

Sticky routing

After /select repowire, every message you type opens a tracked ask to repowire until you /clear or /select another peer. Use /notify message or /fyi message when you explicitly want a fire-and-forget FYI instead. The bot displays the current sticky target in its reply keyboard so you can see where messages are going.

The reply keyboard shows up to three current peers and three recent peers, with markers indicating which is which.

Human framing

Agents on the receiving end see @telegram as a human. Repowire injects a context line at message-arrival time telling the agent that @telegram is the user, not an agent — so the agent treats the message as a direct user instruction rather than agent-to-agent traffic.

To send something to your phone from an agent:

notify_peer("telegram", "deploy finished, green across CI")

Attachments

The bot downloads photos sent in Telegram, uploads them to the daemon via POST /attachments, and sends both the attachment metadata and a text fallback with the resulting local path in the outgoing ask. The recipient agent can then read the image via its multimodal tool — Claude's Read tool, for instance, accepts the local path directly.

When messages arrive from Repowire with attachment metadata, the bot sends local image files as Telegram photos and other local files as documents when it can access the daemon-local path. If the file is not local to the bot, it falls back to a download link.

Attachments live in ~/.repowire/attachments/ with a 24-hour TTL.

Self-host vs hosted

The bot ships in the same repowire package. There is no hosted Telegram bot — you bring your own bot via @BotFather on Telegram, configure the token, and run repowire telegram start somewhere. The relay does not proxy Telegram traffic; the bot talks directly to Telegram's API and to your local daemon.

Troubleshooting

  • Bot doesn't respond to /peers — confirm TELEGRAM_BOT_TOKEN is set and the bot is registered with @BotFather.
  • Messages route to the wrong peer — check the current sticky target with /peers; /clear resets it.
  • Photos don't reach the agent — confirm the daemon is reachable from the bot host and /attachments is not blocked by a proxy.