Telegram Bot Setup

aidaemon uses Telegram as its primary user interface via the teloxide framework.

Create a Bot

  1. Message @BotFather on Telegram
  2. Send /newbot and follow the prompts
  3. Copy the bot token (format: 123456789:ABCdefGHIjklMNOpqrSTUvwxYZ)

Get Your User ID

Your numeric Telegram user ID is needed for the allowed_user_ids list. You can find it by messaging @userinfobot.

Configuration

config.toml
[telegram]
bot_token = "123456789:ABCdefGHIjklMNOpqrSTUvwxYZ"
allowed_user_ids = [123456789]
Access Control
If allowed_user_ids is empty, anyone who finds your bot can chat with it. Always set this in production.

Features

  • Typing indicator — sent every 4 seconds during agent processing
  • Markdown rendering — agent responses are converted to Telegram HTML
  • Long message splitting — responses over 4096 chars are split at paragraph/line boundaries
  • Screenshot sharing — browser screenshots sent as photos with captions

Retry Behavior

The Telegram dispatcher uses exponential backoff on crashes:

  • Initial backoff: 5s
  • Doubles each crash: 5s → 10s → 20s → 40s → 60s (max)
  • Resets to 5s if the bot runs stable for 60+ seconds