$ @BotFather /newbot
Integrations

Telegram Bot Setup: Complete Configuration for DMs and Groups

Step-by-step guide to creating a Telegram bot, configuring privacy mode, setting up group permissions, and troubleshooting common issues like IPv6 DNS failures.

OT
OPENCLAW.EXPERT TEAM
|JAN 10, 2025|10 MIN READ

Creating Your Telegram Bot

Step 1: Create Bot with BotFather

  • Open Telegram and search for @BotFather

  • Send /newbot

  • Choose a name for your bot (e.g., "My OpenClaw Assistant")

  • Choose a username ending in "bot" (e.g., "myopenclawbot")

  • Copy the API token provided
  • Step 2: Configure OpenClaw

    Add your bot token to the config:

    openclaw config set channels.telegram.token "YOUR_BOT_TOKEN"

    Or edit ~/.openclaw/openclaw.json:

    {
    "channels": {
    "telegram": {
    "enabled": true,
    "token": "123456:ABC-DEF1234ghIkl-zyx57W2v1u123ew11"
    }
    }
    }

    Privacy Mode vs Admin Status

    Privacy Mode (Default)

    By default, Telegram bots can only see:

  • Messages that mention the bot directly

  • Replies to the bot's messages

  • Commands starting with /
  • Disabling Privacy Mode

    To let your bot see all group messages:

  • Message @BotFather

  • Send /setprivacy

  • Select your bot

  • Choose "Disable"
  • Alternatively, make the bot an admin in the group.

    Group Configuration

    Mention Patterns

    Configure how the bot responds in groups:

    {
    "channels": {
    "telegram": {
    "groupMentionPattern": "@mybot|hey bot"
    }
    }
    }

    Draft Streaming

    Enable real-time response streaming (requires threaded mode):

    {
    "channels": {
    "telegram": {
    "draftStreaming": true
    }
    }
    }

    Troubleshooting

    IPv6 DNS Issues

    If you see "sendMessage failed" errors:

    Cause: Your system resolves Telegram to IPv6 but IPv6 egress is blocked.

    Solution: Force IPv4 in your DNS configuration or enable IPv6 on your VPS.

    Bot Not Responding

    Check that:

  • Bot token is correct

  • Privacy mode is disabled (for groups)

  • Gateway is running: openclaw status

  • Telegram channel is enabled: openclaw channels status
  • Need Professional Setup?

    Contact us and we'll configure your Telegram bot with optimal settings.

    Need Professional OpenClaw Setup?

    Skip the technical hassle. Our expert team handles installation, configuration, and ongoing support so you can focus on what matters.

    Related Articles