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

# Discord

> Connect your agent to a Discord server

# Discord Setup

Connect your Vecbase agent to Discord so users in your server can chat with it.

## Prerequisites

* A Discord account
* A Discord server where you have admin permissions
* A Vecbase agent created

## Step 1: Create a Discord Application

<Steps>
  <Step title="Open Developer Portal">
    Go to [Discord Developer Portal](https://discord.com/developers/applications) and log in.
  </Step>

  <Step title="Create application">
    Click **New Application**. Give it a name (e.g., "Vecbase Assistant").
  </Step>

  <Step title="Create a bot">
    Go to the **Bot** section in the left sidebar. Click **Add Bot** → **Yes, do it!**
  </Step>

  <Step title="Copy bot token">
    Click **Reset Token** to generate a new token, then copy it:

    ```
    MTI3NjU0MzIxMDk4NzY1NDMy.GH8k2w.abc123...
    ```

    <Warning>
      You can only see the token once. If you lose it, you'll need to reset it.
    </Warning>
  </Step>

  <Step title="Enable intents">
    Scroll down to **Privileged Gateway Intents** and enable:

    * ✅ **Message Content Intent** (required to read messages)
    * ✅ **Server Members Intent** (required for member info)
  </Step>
</Steps>

## Step 2: Invite Bot to Your Server

<Steps>
  <Step title="Generate invite URL">
    Go to **OAuth2** → **URL Generator**.

    Select scopes:

    * ✅ `bot`
    * ✅ `applications.commands`

    Select bot permissions:

    * ✅ Send Messages
    * ✅ Read Message History
    * ✅ Attach Files
    * ✅ Add Reactions
    * ✅ Manage Threads
  </Step>

  <Step title="Invite the bot">
    Copy the generated URL and open it in your browser. Select the server and click **Authorize**.
  </Step>
</Steps>

## Step 3: Connect in Vecbase

<Steps>
  <Step title="Open agent settings">
    Open your agent, tap **Settings** in the top right, then select **Channels**.
  </Step>

  <Step title="Add Discord channel">
    Click **Add Channel** next to **Discord**.
  </Step>

  <Step title="Enter credentials">
    * **Display Name**: A name for this channel (e.g., "Dev Server Bot")
    * **Bot Token**: Paste the token from Step 1
    * **Application ID**: Copy from Discord Developer Portal → **General Information**
  </Step>

  <Step title="Create">
    Click **Create**. Status will change to **Connected**.
  </Step>
</Steps>

## Step 4: Test

Go to your Discord server and send a message in a channel where the bot has access. The bot will respond automatically.

<Info>
  In servers with many channels, the bot responds only in channels where it has **Send Messages** permission. You can use Discord's channel permissions to control where the bot is active.
</Info>

## Limitations

| Limit          | Value                                   |
| -------------- | --------------------------------------- |
| File upload    | 25 MB (default, 50 MB with Nitro boost) |
| Message length | 2,000 characters                        |
