Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.wednesdayai.dev/llms.txt

Use this file to discover all available pages before exploring further.

Telegram

WednesdayAI connects to Telegram via the Bot API using long polling (default) or webhooks. Setup requires a bot token from BotFather — there is no QR scanning or phone number linking.

Quick setup

1. Create a bot in BotFather:
  1. Open Telegram and message @BotFather
  2. Send /newbot and follow the prompts
  3. Copy the bot token (format: 123456789:AABBCCxyz...)
2. Configure the bot token and access policy:
// ~/.openclaw/openclaw.json
{
  channels: {
    telegram: {
      enabled: true,
      botToken: "123456789:AABBCCxyz...",
      dmPolicy: "pairing",
      groups: {
        "*": { requireMention: true },
      },
    },
  },
}
Alternatively via environment variable (default account only):
echo 'TELEGRAM_BOT_TOKEN=123456789:AABBCCxyz...' >> ~/.openclaw/.env
3. Start the gateway:
openclaw gateway run
Telegram uses long polling — no webhook URL setup needed for the default mode. The bot is ready as soon as the gateway connects. 4. Pair your first user: When someone DMs the bot for the first time, they receive a pairing code. Approve it:
openclaw pairing list telegram
openclaw pairing approve telegram <CODE>

Finding user IDs

Telegram allowlists use numeric user IDs, not usernames.
# Method 1: DM your bot and read from gateway logs
openclaw logs --follow | grep "from.id"

# Method 2: Third-party bots
# @userinfobot or @getidsbot

Access control

DM policy

{
  channels: {
    telegram: {
      dmPolicy: "pairing",           // pairing | allowlist | open | disabled
      allowFrom: ["123456789"],      // numeric Telegram user IDs
    },
  },
}
dmPolicy: "allowlist" with empty allowFrom is rejected by config validation — it would block all DMs.

Group policy

{
  channels: {
    telegram: {
      groupPolicy: "allowlist",      // open | allowlist | disabled
      groupAllowFrom: ["123456789"],
      groups: {
        "*": { requireMention: true },                // any group
        "-1001234567890": {                           // specific group
          requireMention: false,
          groupPolicy: "open",
        },
      },
    },
  },
}
To find a group’s chat ID: forward a message from the group to @userinfobot, or read chat.id from openclaw logs --follow.

Group privacy mode

Telegram bots default to Privacy Mode — they only see messages that mention them or start with /. To receive all messages in a group:
  • In BotFather: /setprivacy → select your bot → Disable
  • Or make the bot a group admin
  • Remove and re-add the bot after changing privacy mode
openclaw channels status warns when Privacy Mode may be causing missed messages.

Native commands

Telegram supports native slash commands with autocomplete. Enable them:
{
  commands: {
    native: "auto",   // enables native commands for Telegram (and Discord)
  },
}
Custom command menu entries:
{
  channels: {
    telegram: {
      customCommands: [
        { command: "briefing", description: "Daily briefing" },
        { command: "status", description: "Check status" },
      ],
    },
  },
}

Live streaming

{
  channels: {
    telegram: {
      streaming: "partial",   // off | partial | block | progress
    },
  },
}
partial (default): updates the message in-place as tokens arrive — shows a typing indicator effect.

Troubleshooting

Telegram Privacy Mode is probably enabled. Check:
  1. BotFather: /setprivacy → should say Disabled
  2. Remove and re-add the bot to the group after changing
  3. If the bot needs to see all messages (not just mentions), make it a group admin
Check channels.telegram.groups — the group ID must be in the allowlist (or use "*" to allow all groups). Get the group ID from openclaw logs --follow.
DNS/HTTPS to api.telegram.org is blocked. Check network connectivity from the gateway host.
Some environments have IPv6 issues with Telegram’s API servers. Try:
{ channels: { telegram: { network: { dnsResultOrder: "ipv4first" } } } }