Skip to main content
The user deploys role-specific bots on one platform; each token routes to its agent. Deploy multiple specialized bots on the same platform with unique tokens and role-specific routing.

Quick Start

Bot(...).run() auto-reconnects on a dropped connection by default — see Auto-reconnect on long-running-bots.
1

Run onboard wizard

Start the wizard and choose your platform:
Choose telegram for your first platform, then when prompted “Add another bot channel?” answer Yes and enter roles like cfo, ops, content.
2

Configure tokens

The wizard generates unique environment variables for each channel:
If you leave TELEGRAM_ALLOWED_USERS empty, you must also set unknown_user_policy: "allow" for the bot to reply to anyone (since PR #1885). For production, set TELEGRAM_ALLOWED_USERS to your user IDs and leave unknown_user_policy at the default "deny".
3

Start the gateway

Launch all bots simultaneously:
All configured bots will connect and route to their specialized agents.

How It Works

Multi-channel setup routes each bot to its specialized agent based on the channel configuration.

Environment Variable Convention

Follow this exact naming pattern for multiple bots on the same platform:
Channel keyEnvironment VariableBot Purpose
telegram_cfoTELEGRAM_CFO_BOT_TOKENCFO-related tasks
telegram_opsTELEGRAM_OPS_BOT_TOKENOperations tasks
telegram_contentTELEGRAM_CONTENT_BOT_TOKENContent creation
telegram_supportTELEGRAM_SUPPORT_BOT_TOKENCustomer support
Pattern: <PLATFORM>_<ROLE>_BOT_TOKEN (uppercase, role separated by underscore).

Example Configuration

This bot.yaml shows a complete multi-channel workforce setup:

Common Patterns

Deploy multiple specialized bots on one platform:

Validation with praisonai doctor

The multi_channel_tokens check validates your setup:

PASS Conditions

  • Each channel has a unique environment variable
  • Each environment variable resolves to a unique token value
  • Follows PLATFORM_<ROLE>_BOT_TOKEN naming convention

WARN Conditions

  • Environment variable doesn’t follow naming convention
  • Environment variable is unset but referenced in config

FAIL Conditions

  • Two channels point to the same environment variable
  • Two environment variables resolve to the same token value
Sample output:
Remediation: Each channel must have a unique bot token. Create separate bots in @BotFather and use unique environment variables.

Best Practices

Create a separate bot in @BotFather for each role. Never reuse the same token across multiple channels as this will cause conflicts and validation failures.
Stick to the PLATFORM_<ROLE>_BOT_TOKEN pattern so the doctor check passes. This makes it clear which token belongs to which channel and role.
Keep all role tokens in ~/.praisonai/.env with chmod 600 permissions. Never commit tokens to version control or share them publicly.
Each role can have its own allowed_users environment variable for granular access control. For example, only finance team members should access the CFO bot.

When to Use Multi-Channel


Bot Onboarding

Set up your first bot with the interactive wizard

Messaging Bots

Core bot functionality and platform integration

Bot Routing

Advanced routing patterns and agent selection

Bot Security

Security best practices for bot deployments