> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chatbotplatform.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Multi-Channel Bot Deployment

> Deploy your bot across Telegram, Slack, Discord, and more with unified management

Learn how to deploy a single bot across multiple messaging platforms while maintaining consistent behavior, shared conversation history, and unified management. This guide covers deployment strategies, platform-specific considerations, and best practices for multi-channel bots.

## What You'll Learn

By the end of this guide, you'll be able to:

* Deploy one bot to multiple messaging platforms
* Configure platform-specific behaviors
* Maintain consistent responses across channels
* Handle platform differences gracefully
* Manage per-channel settings and routing
* Monitor performance across all channels

## Prerequisites

Before starting, you should have:

* A working bot with at least one channel configured
* Completed the [Basic Support Bot](https://docs.chatbotplatform.io/guides/support-bot-basics.md) guide
* Accounts on the platforms you want to deploy to (Telegram, Slack, Discord, etc.)
* 20-30 minutes for setup

## Why Multi-Channel?

### Reach Users Where They Are

Different users prefer different platforms:

* **Telegram**: Mobile-first users, international audience
* **Slack**: Professional teams, workplace communication
* **Discord**: Gaming communities, online groups
* **WhatsApp**: Personal communication, global reach

### Unified Management

Deploy once, manage everywhere:

* Single bot configuration
* One integration handles all platforms
* Unified conversation history
* Centralized analytics
* Consistent AI responses

### Cost Effective

One AI integration serves all channels:

* Share API costs across platforms
* Single system prompt for all channels
* Unified testing and monitoring
* Centralized maintenance

## Architecture Overview

```
Single Bot Instance
├── Integration (One AI backend)
│   └── Handles all incoming messages
├── Telegram Channel
│   ├── Native typing indicators
│   ├── Group support
│   └── Per-user context
├── Slack Channel
│   ├── Thread-based conversations
│   ├── Workspace integration
│   └── App Home
├── Discord Channel
│   ├── Server and DM support
│   ├── Thread support
│   └── Rich embeds
└── WhatsApp Channel (Future)
    ├── Personal messaging
    └── Business API integration
```

Each channel maintains its own:

* Connection credentials
* Platform-specific settings
* Rate limits and constraints

All channels share:

* AI integration
* System prompt
* Bot behaviors
* Conversation history (per user, per channel)

## Step 1: Deploy to Telegram

**1. Create Telegram Bot**

1. Open [@BotFather](https://t.me/BotFather) on Telegram
2. Send `/newbot`
3. Follow prompts to choose name and username
4. Copy the bot token

**2. Add Telegram Channel**

In Chatbot Platform:

1. Go to your bot → **Channels**
2. Click **Create Channel**
3. Select **Telegram**
4. Paste bot token
5. Click **Create**

![Telegram configuration](https://mintlify.s3.us-west-1.amazonaws.com/chatbotplatform/images/screenshots/03-channels/01_telegram_form.png)

Telegram channel setup

**3. Configure Telegram Settings**

Optional platform-specific settings:

* Group privacy mode (disabled for full context)
* Bot commands via BotFather
* Bot description and profile picture

**4. Test Telegram**

1. Find your bot in Telegram
2. Send a message
3. Verify response from your integration

### Telegram Features

**Strengths:**

* Native typing indicators
* Fast message delivery
* Great for groups
* International reach
* Simple setup

**Considerations:**

* Rate limits: 1 msg/sec per chat
* Token security is critical
* Privacy mode affects group behavior

## Step 2: Deploy to Slack

**1. Create Slack App**

1. Go to [api.slack.com/apps](https://api.slack.com/apps)
2. Click **Create New App** → From scratch
3. Enter app name and select workspace
4. Click **Create App**

![Slack app form](https://mintlify.s3.us-west-1.amazonaws.com/chatbotplatform/images/screenshots/03-channels/02_slack_form.png)

Slack app creation

**2. Configure OAuth Scopes**

In your Slack app settings:

1. Go to **OAuth & Permissions**
2. Add these Bot Token Scopes:
   * `chat:write` - Send messages
   * `chat:read` - Read messages
   * `im:history` - Access DM history
   * `im:write` - Send DMs
   * `channels:history` - Read channel messages (for channels)
   * `groups:history` - Read private channels (if needed)
3. Click **Install to Workspace**
4. Authorize the app

**3. Get Credentials**

Copy these values:

* **Bot User OAuth Token**: Starts with `xoxb-`
* **Signing Secret**: From **Basic Information**

**4. Add Slack Channel**

In Chatbot Platform:

1. Go to your bot → **Channels**
2. Click **Create Channel**
3. Select **Slack**
4. Enter:
   * Bot Token (xoxb-...)
   * Signing Secret
5. Click **Create**

**5. Configure Event Subscriptions**

Back in Slack app settings:

1. Go to **Event Subscriptions**
2. Enable Events
3. The platform provides a webhook URL - copy it
4. Enter as Request URL
5. Wait for verification
6. Subscribe to these bot events:
   * `message.im` - Direct messages
   * `message.channels` - Channel messages (if needed)
   * `app_mention` - @mentions
7. Save changes

**6. Test Slack**

1. Open Slack workspace
2. Find your bot in Apps
3. Send a direct message
4. Verify response

### Slack Features

**Strengths:**

* Thread-based conversations
* Rich formatting (buttons, blocks)
* Workspace integration
* Professional audience
* App Home for bot info

**Considerations:**

* More complex setup than Telegram
* Thread context is important
* Rate limits: tier-based
* Requires public webhook URL

**Thread Behavior:**
Configure in Bot Behaviors:

* **Thread-based replies**: Bot responds in threads where it's active
* **Mention detection**: Respond only when @mentioned
* **DM vs Channel**: Different context per environment

## Step 3: Deploy to Discord

**1. Create Discord Application**

1. Go to [discord.com/developers/applications](https://discord.com/developers/applications)
2. Click **New Application**
3. Enter application name
4. Click **Create**

**2. Create Bot User**

1. In your application, go to **Bot**
2. Click **Add Bot** → Yes, do it!
3. Under Token, click **Reset Token**
4. Copy the bot token (save it securely)

**3. Configure Bot Permissions**

1. Go to **OAuth2** → **URL Generator**
2. Select scopes:
   * `bot`
   * `applications.commands` (for slash commands)
3. Select bot permissions:
   * Send Messages
   * Read Message History
   * Use External Emojis
   * Embed Links
   * Attach Files
4. Copy the generated URL

**4. Add Bot to Server**

1. Open the generated URL in browser
2. Select your Discord server
3. Click **Authorize**
4. Complete captcha

**5. Add Discord Channel**

In Chatbot Platform:

1. Go to your bot → **Channels**
2. Click **Create Channel**
3. Select **Discord**
4. Enter bot token
5. Click **Create**

**6. Test Discord**

1. Go to your Discord server
2. Find a channel where bot has permissions
3. Send a message
4. Verify bot responds

### Discord Features

**Strengths:**

* Rich embeds and formatting
* Thread support
* Voice channel integration
* Large community support
* Slash commands

**Considerations:**

* Requires server invite
* Permissions management
* Message intent requirements for large bots
* Rate limits vary by endpoint

## Step 4: Configure Multi-Channel Behaviors

Now optimize behaviors for each platform.

**1. Set Global Behaviors**

In Bot Behaviors, set defaults for all channels:

* **Context Window**: 15 messages
* **Typing Indicators**: Enabled (platforms that support it)
* **Response Timeout**: 30 seconds

**2. Configure Per-Channel Settings**

Override settings for specific channels:

**Telegram:**

* Reply detection: All messages (for support)
* Typing indicators: Enabled (native support)

**Slack:**

* Reply detection: Thread-based
* Typing indicators: Enabled
* Format: Use Slack markdown

**Discord:**

* Reply detection: Mention-based
* Typing indicators: Enabled
* Format: Use Discord markdown

**3. Test Cross-Platform**

Send the same question on each platform and verify:

* Response is consistent
* Formatting renders correctly
* Timing feels natural
* Context is maintained separately per channel

## Platform-Specific Optimizations

### Telegram Optimizations

```
System prompt addition:
"For Telegram users, keep responses concise.
Use emoji sparingly. Provide links in markdown format."
```

**Features to leverage:**

* Inline keyboards (coming soon)
* Location sharing
* Media messages

### Slack Optimizations

```
System prompt addition:
"For Slack users, use threaded replies to keep channels clean.
Format responses with Slack markdown (use *bold* for emphasis).
Reference threads and users with proper @ mentions."
```

**Features to leverage:**

* Blocks and interactive components
* App Home for documentation
* Slash commands for quick actions
* Rich link previews

### Discord Optimizations

```
System prompt addition:
"For Discord users, use rich embeds when appropriate.
Format code with Discord markdown (triple backticks).
Keep responses engaging for community context."
```

**Features to leverage:**

* Rich embeds with colors and fields
* Reactions for quick feedback
* Thread support for long discussions
* Server-specific context

## Handling Platform Differences

### Message Formatting

Different platforms use different markdown:

```javascript theme={null}
// In your integration, detect platform and format accordingly
function formatResponse(text, platform) {
  switch(platform) {
    case 'telegram':
      return text
        .replace(/\*\*(.*?)\*\*/g, '*$1*') // Bold
        .replace(/\*(.*?)\*/g, '_$1_');     // Italic

    case 'slack':
      return text
        .replace(/\*\*(.*?)\*\*/g, '*$1*')  // Bold
        .replace(/\*(.*?)\*/g, '_$1_');     // Italic

    case 'discord':
      return text; // Discord uses standard markdown

    default:
      return text;
  }
}
```

### Rate Limits

Respect platform-specific rate limits:

| Platform | Rate Limit | Strategy |
| - | - | - |
| Telegram | 1 msg/sec per chat | Queue messages |
| Slack | Tier-based (1+ msg/sec) | Burst then throttle |
| Discord | 5 msg/5sec per channel | Queue with delay |

The platform handles this automatically, but be aware for high-volume scenarios.

### Context Preservation

Each platform maintains separate conversation history:

```
User "Alice" on Telegram: "What's your refund policy?"
User "Alice" on Slack: "How do I contact support?"

→ Two separate conversations
→ Different context windows
→ Platform metadata included in each
```

To link conversations across platforms:

* Use external user ID mapping
* Reference conversation archives
* Include cross-platform identifiers in metadata

## API Examples

> [accordion] Send message to specific channel
>
> > [tab] cURL
> >
> > ```bash theme={null}
> > curl -X POST https://api.chatbotplatform.io/v1/messages \
> >   -H "Authorization: Bearer YOUR_API_KEY" \
> >   -H "Content-Type: application/json" \
> >   -d '{
> >     "bot_id": "bot_123",
> >     "channel_id": "channel_456",
> >     "chat_id": "user_or_chat_id",
> >     "message": "Hello from Telegram!"
> >   }'
> > ```
>
> > [tab] JavaScript
> >
> > ```javascript theme={null}
> > const response = await fetch('https://api.chatbotplatform.io/v1/messages', {
> >   method: 'POST',
> >   headers: {
> >     'Authorization': 'Bearer YOUR_API_KEY',
> >     'Content-Type': 'application/json'
> >   },
> >   body: JSON.stringify({
> >     bot_id: 'bot_123',
> >     channel_id: 'channel_456',
> >     chat_id: 'user_or_chat_id',
> >     message: 'Hello from Telegram!'
> >   })
> > });
> >
> > const result = await response.json();
> > ```
>
> > [tab] PHP
> >
> > ```php theme={null}
> > $result = Http::withToken('YOUR_API_KEY')
> >     ->post('https://api.chatbotplatform.io/v1/messages', [
> >         'bot_id' => 'bot_123',
> >         'channel_id' => 'channel_456',
> >         'chat_id' => 'user_or_chat_id',
> >         'message' => 'Hello from Telegram!'
> >     ]);
> > ```
>
> > [tab] Python
> >
> > ```python theme={null}
> > response = requests.post(
> >     'https://api.chatbotplatform.io/v1/messages',
> >     headers={'Authorization': 'Bearer YOUR_API_KEY'},
> >     json={
> >         'bot_id': 'bot_123',
> >         'channel_id': 'channel_456',
> >         'chat_id': 'user_or_chat_id',
> >         'message': 'Hello from Telegram!'
> >     }
> > )
> >
> > result = response.json()
> > ```

> [accordion] List all channels for a bot
>
> > [tab] cURL
> >
> > ```bash theme={null}
> > curl https://api.chatbotplatform.io/v1/bots/bot_123/channels \
> >   -H "Authorization: Bearer YOUR_API_KEY"
> > ```
>
> > [tab] JavaScript
> >
> > ```javascript theme={null}
> > const response = await fetch(
> >   'https://api.chatbotplatform.io/v1/bots/bot_123/channels',
> >   {
> >     headers: {
> >       'Authorization': 'Bearer YOUR_API_KEY'
> >     }
> >   }
> > );
> >
> > const channels = await response.json();
> > console.log('Active channels:', channels);
> > ```
>
> > [tab] PHP
> >
> > ```php theme={null}
> > $channels = Http::withToken('YOUR_API_KEY')
> >     ->get('https://api.chatbotplatform.io/v1/bots/bot_123/channels')
> >     ->json();
> > ```
>
> > [tab] Python
> >
> > ```python theme={null}
> > response = requests.get(
> >     'https://api.chatbotplatform.io/v1/bots/bot_123/channels',
> >     headers={'Authorization': 'Bearer YOUR_API_KEY'}
> > )
> >
> > channels = response.json()
> > ```

> [accordion] Broadcast message to all channels
>
> > [tab] cURL
> >
> > ```bash theme={null}
> > curl -X POST https://api.chatbotplatform.io/v1/broadcasts \
> >   -H "Authorization: Bearer YOUR_API_KEY" \
> >   -H "Content-Type: application/json" \
> >   -d '{
> >     "bot_id": "bot_123",
> >     "message": "System maintenance tonight at midnight",
> >     "target": "all_channels"
> >   }'
> > ```
>
> > [tab] JavaScript
> >
> > ```javascript theme={null}
> > const response = await fetch('https://api.chatbotplatform.io/v1/broadcasts', {
> >   method: 'POST',
> >   headers: {
> >     'Authorization': 'Bearer YOUR_API_KEY',
> >     'Content-Type': 'application/json'
> >   },
> >   body: JSON.stringify({
> >     bot_id: 'bot_123',
> >     message: 'System maintenance tonight at midnight',
> >     target: 'all_channels'
> >   })
> > });
> >
> > const broadcast = await response.json();
> > ```
>
> > [tab] PHP
> >
> > ```php theme={null}
> > $broadcast = Http::withToken('YOUR_API_KEY')
> >     ->post('https://api.chatbotplatform.io/v1/broadcasts', [
> >         'bot_id' => 'bot_123',
> >         'message' => 'System maintenance tonight at midnight',
> >         'target' => 'all_channels'
> >     ]);
> > ```
>
> > [tab] Python
> >
> > ```python theme={null}
> > response = requests.post(
> >     'https://api.chatbotplatform.io/v1/broadcasts',
> >     headers={'Authorization': 'Bearer YOUR_API_KEY'},
> >     json={
> >         'bot_id': 'bot_123',
> >         'message': 'System maintenance tonight at midnight',
> >         'target': 'all_channels'
> >     }
> > )
> >
> > broadcast = response.json()
> > ```

For complete API documentation, see the [OpenAPI specification](https://app.chatbotplatform.io/openapi).

## Monitoring Multi-Channel Performance

### Key Metrics to Track

**Per Channel:**

* Message volume
* Response times
* Error rates
* User engagement

**Cross-Channel:**

* Total conversations
* Integration performance
* Cost per channel
* User distribution

### Example Monitoring Setup

```javascript theme={null}
// Log metrics from your integration
app.post('/bot-integration', async (req, res) => {
  const startTime = Date.now();
  const { metadata } = req.body;
  const platform = metadata.channel;

  try {
    // Your integration logic
    const response = await processMessage(req.body);

    // Log success metrics
    logMetric({
      platform,
      status: 'success',
      responseTime: Date.now() - startTime,
      tokensUsed: response.tokens
    });

    res.json(response);
  } catch (error) {
    // Log error metrics
    logMetric({
      platform,
      status: 'error',
      errorType: error.type,
      responseTime: Date.now() - startTime
    });

    res.status(500).json({ error: error.message });
  }
});
```

## Best Practices

> [card] Test Each Platform
>
> Verify formatting and features work correctly on each channel

> [card] Document Differences
>
> Keep notes on platform-specific behaviors and limitations

> [card] Monitor Separately
>
> Track metrics per channel to identify issues quickly

> [card] Gradual Rollout
>
> Launch on one platform, stabilize, then expand

### Integration Design

**Detect Platform Early:**

```javascript theme={null}
function handleMessage(request) {
  const platform = request.metadata.channel;

  // Platform-specific logic
  if (platform === 'slack') {
    // Handle threads, blocks
  } else if (platform === 'telegram') {
    // Handle inline keyboards, location
  } else if (platform === 'discord') {
    // Handle embeds, reactions
  }

  // Shared AI logic
  const response = await callAI(request);

  // Format for platform
  return formatForPlatform(response, platform);
}
```

**Unified System Prompt:**

```
You are a helpful assistant available on multiple platforms:
Telegram, Slack, and Discord.

Adapt your responses based on the platform:
- Slack: Use threaded replies, professional tone
- Telegram: Concise, mobile-friendly responses
- Discord: Engaging, community-focused tone

Always maintain consistent information across platforms.
```

## Troubleshooting

### Messages not delivered on specific channel

**Possible causes:**

* Channel credentials expired or invalid
* Bot removed from server/workspace
* Permissions insufficient
* Rate limit exceeded

**Solutions:**

* Check channel status in dashboard
* Verify bot is still present in target platform
* Review permission scopes
* Check rate limit logs

### Different responses across channels

**Cause:** Platform-specific formatting or context handling

**Solutions:**

* Test with identical messages
* Check system prompt doesn't over-customize per platform
* Verify integration returns consistent content
* Review conversation context windows

### High latency on one channel

**Cause:** Platform-specific API performance or network issues

**Solutions:**

* Check platform status pages
* Review integration logs for slow API calls
* Consider caching for frequently accessed data
* Test from different network locations

## Advanced Patterns

### Channel-Specific Routing

Route certain queries to specific channels:

```javascript theme={null}
// In your integration
if (message.includes('urgent') && platform === 'slack') {
  // Send to Slack emergency channel
  await notifyChannel('#emergencies', message);
} else if (platform === 'telegram') {
  // Standard response
  return standardResponse;
}
```

### Cross-Channel Notifications

Notify users on multiple channels:

```javascript theme={null}
// When important event occurs
async function notifyAllChannels(userId, message) {
  const channels = await getUserChannels(userId);

  for (const channel of channels) {
    await sendMessage({
      bot_id: 'bot_123',
      channel_id: channel.id,
      user_id: userId,
      message: message
    });
  }
}
```

### Platform Migration

Help users migrate from one platform to another:

```
User on Telegram: "Can I switch to Slack?"

Bot: "Yes! I'm available on Slack too. Add me to your workspace:
[Add to Slack button/link]

Your conversation history will start fresh on Slack, but I'm
the same assistant with the same capabilities."
```

## Next Steps

> [card] [Conversation Context](https://docs.chatbotplatform.io/guides/conversation-context.md)
>
> Manage context across channels

> [card] [Webhook Integration](https://docs.chatbotplatform.io/guides/webhook-integration-guide.md)
>
> Advanced integration patterns

> [card] [Channel Documentation](https://docs.chatbotplatform.io/bots/channels/index.md)
>
> Detailed channel-specific docs

> [card] [Bot Behaviors](https://docs.chatbotplatform.io/bots/behaviors/index.md)
>
> Configure platform behaviors

## Related Documentation

* [Telegram Channel](https://docs.chatbotplatform.io/bots/channels/telegram.md) - Telegram-specific setup and features
* [Slack Channel](https://docs.chatbotplatform.io/bots/channels/slack.md) - Slack integration details
* [Discord Channel](https://docs.chatbotplatform.io/bots/channels/discord) - Discord configuration
* [Bot Behaviors](https://docs.chatbotplatform.io/bots/behaviors/index.md) - Behavior customization
* [API Reference](https://app.chatbotplatform.io/openapi) - Complete API docs


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.