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

# Discord Adapter

> Deploy your bot to Discord

## Setup

### 1. Create Discord Bot

**1. Create application**

Go to [Discord Developer Portal](https://discord.com/developers/applications)

**2. Create bot**

Navigate to Bot section and create a bot user

**3. Enable intents**

Enable **MESSAGE CONTENT INTENT** in Bot settings

**4. Copy token**

Copy your bot token

### 2. Install Dependencies

```bash theme={null}
npm install @boostgpt/router
```

### 3. Configure

```bash .env theme={null}
DISCORD_TOKEN=your_discord_bot_token
BOOSTGPT_BOT_ID=your_boostgpt_bot_id
```

## Usage

```javascript theme={null}
import { Router, DiscordAdapter } from '@boostgpt/router';

const router = new Router({
  apiKey: process.env.BOOSTGPT_API_KEY,
  projectId: process.env.BOOSTGPT_PROJECT_ID,
  adapters: [
    new DiscordAdapter({
      discordToken: process.env.DISCORD_TOKEN,
      botId: process.env.BOOSTGPT_BOT_ID,
      replyInDMs: true,
      replyOnMention: true
    })
  ]
});

await router.start();
```

## Configuration Options

**discordToken** `string` *required*

Discord bot token

**botId** `string`

BoostGPT bot ID

**replyInDMs** `boolean` (default: true)

Reply to direct messages

**replyOnMention** `boolean` (default: true)

Reply when mentioned


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