Introduction
Beyond WhatsApp, OpenClaw supports running separate Discord and Telegram bots per agent. Each bot gets its own token and can be bound to a specific agent, allowing specialized bots for different communities or purposes.
Key Concepts
- Bot Token: A unique authentication credential for a Discord or Telegram bot. Each agent gets its own token.
- BotFather: Telegram's official bot for creating and managing bot tokens.
- Discord Developer Portal: Where you create Discord applications and generate bot tokens.
- Account-Level Routing: Binding a specific bot token (account) to a specific agent.
Real World Context
A gaming company runs a Discord server with two bots: a moderation bot that monitors chat and enforces rules, and a support bot that answers player questions. Each bot has its own Discord application, its own avatar, and its own set of permissions. Players see two distinct bots, but both are powered by the same OpenClaw gateway with different agent configurations.
Deep Dive
For Discord, create a separate bot application for each agent:
bash# Add first Discord bot openclaw channels login discord --token "${DISCORD_MOD_BOT_TOKEN}" --label "Mod Bot" # Add second Discord bot openclaw channels login discord --token "${DISCORD_SUPPORT_BOT_TOKEN}" --label "Support Bot"
Each bot token creates a separate Discord presence. The moderation bot and support bot appear as different users in the server, each with their own name and avatar.
For Telegram, create bots via BotFather:
bash# Add first Telegram bot openclaw channels login telegram --token "${TELEGRAM_ALERTS_TOKEN}" --label "Alerts Bot" # Add second Telegram bot openclaw channels login telegram --token "${TELEGRAM_ASSISTANT_TOKEN}" --label "Assistant Bot"
Then bind each bot to its agent:
json{ "agents": { "moderator": { "bindings": [ { "type": "account", "accountId": "discord:mod-bot" } ] }, "support": { "bindings": [ { "type": "account", "accountId": "discord:support-bot" }, { "type": "account", "accountId": "telegram:assistant-bot" } ] }, "alerter": { "bindings": [ { "type": "account", "accountId": "telegram:alerts-bot" } ] } } }
This configuration shows that agents can span channels — the support agent handles both Discord and Telegram through different bot accounts.
Common Pitfalls
- Reusing bot tokens across gateways — A single bot token can only be connected to one gateway at a time. Running the same token on two gateways causes disconnection loops.
- Forgetting Discord bot intents — Discord bots need specific intents enabled in the Developer Portal (Message Content, Guild Members) to function correctly.
Best Practices
- Use separate bot applications per agent — This gives each agent its own identity, avatar, and permissions on the platform.
- Store all tokens in environment variables — Never hardcode bot tokens in configuration files.
Summary
- Each agent can have its own Discord bot and Telegram bot with separate tokens
- Discord bots are created in the Developer Portal, Telegram bots via BotFather
- Account-level routing binds specific bot tokens to specific agents
- One agent can handle multiple accounts across different channels
- Always use separate bot applications per agent for clean identity separation