Skip to main content

What You’ll Build

A bot that works on Discord, Telegram, and Slack simultaneously with a single codebase.

Prerequisites

BoostGPT Account

Sign up at app.boostgpt.co

Node.js

Version 14.0.0 or higher

Step 1: Install Dependencies

Step 2: Get Your Tokens

BoostGPT

  1. Go to app.boostgpt.co
  2. Create a project and copy the Project ID
  3. Generate an API Key from API Keys
  4. Create a bot and copy the Bot ID

Discord

  1. Go to Discord Developer Portal
  2. Create a new application
  3. Go to Bot β†’ Create bot
  4. Enable MESSAGE CONTENT INTENT
  5. Copy the bot token

Telegram

  1. Open Telegram and search for @BotFather
  2. Send /newbot and follow instructions
  3. Copy the token provided

Slack

  1. Go to api.slack.com/apps
  2. Create a new app
  3. Enable Socket Mode
  4. Add bot scopes: chat:write, channels:history, im:history
  5. Copy the Bot Token and App Token

Step 3: Configure Environment

Create .env:
.env

Step 4: Create Your Bot

Create bot.js:
bot.js

Step 5: Run Your Bot

You should see:
Your bot is now live on 3 platforms with one codebase!

Step 6: Test It

  • Mention your bot in a channel: @YourBot hello
  • Or DM it directly
  • Try /ping or /status

Understanding the Code

Message Object

Every message has this structure:

Context Object

The context provides channel information:

Message Handler Return Values

Advanced: Custom Logic Per Channel

Adding More Channels

Want to add WhatsApp or Crisp?
Scan the QR code when prompted.

Common Patterns

Broadcasting Messages

Send a message to all channels:

Sending Direct Messages

Dynamic Adapter Management

Troubleshooting

Make sure MESSAGE CONTENT INTENT is enabled in Discord Developer Portal β†’ Bot settings.
Start a chat with your bot first by searching for it in Telegram and clicking Start.
Verify Socket Mode is enabled and you’re using the correct App Token (starts with xapp-).
Check your BoostGPT API key and Project ID in .env.

Next Steps

API Reference

Explore all Router methods

Custom Adapters

Build your own channel adapter

Deployment

Deploy to production

Examples

See real-world use cases