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

# Discord

> 'Access knowledge from your Messages'

## How it works

The Discord connector indexes all channels for all servers(guilds) mentioned.

## Setting up a Bot User

<Steps>
  <Step title="Open Discord developer portal">
    Login to your discord's developer portal [https://discord.com/developers/applications](https://discord.com/developers/applications)
  </Step>

  <Step title="Create application">
    Click on the “New Application” button.
  </Step>

  <Step title="Name and create">
    Give the application a name and click “Create”.
  </Step>

  <Step title="Configure Bot tab">
    Navigate to the “Bot” tab to configure it.
  </Step>

  <Step title="Public Bot option">
    Make sure that Public Bot is ticked if you want others to invite your bot.
  </Step>

  <Step title="Enable privileged intents">
    Under the `Privileged Gateway Intents` make sure `MESSAGE CONTENT INTENT` is checked.
  </Step>

  <Step title="Copy bot token">
    Copy the token using the “Copy” button. If you have lost your token, you can click on `Reset Token`.
  </Step>
</Steps>

## Inviting the Bot User to server(s)

So you've made a Bot User but it's not actually in any server. To add the bot user in your server follow the steps:

<Steps>
  <Step title="Open application">
    Open your application at [https://discord.com/developers/applications](https://discord.com/developers/applications) .
  </Step>

  <Step title="Open Installation tab">
    Head over to the `Installation` tab.
  </Step>

  <Step title="Enable Guild Install">
    Check the `Guild Install` under the Installation contexts.
  </Step>

  <Step title="Add bot scope">
    Add `bot` scope under the scopes for `Guild Install`.
  </Step>

  <Step title="Set minimum permissions">
    Under the permissions section for `Guild Install`, give these minimum permissions `Manage Messages`,
    `Read Message History` and `View Channels`.
  </Step>

  <Step title="Install bot with link">
    Use the `Discord Provided Link` to install the bot to the server(s) you want.
    Make sure you have `Manager server` permissions on that guild or server
  </Step>

  <Step title="Add bot to servers">
    Open the link in the browser and add the bot to your server(s)
  </Step>
</Steps>

### Indexing

<Steps>
  <Step title="Open Discord connector">
    Navigate to the Connector Dashboard and select the **Discord** Connector.
  </Step>

  <Step title="Enter Bot Token">
    Enter the **Bot Token** under credentials you fetched from `Setting up a Bot User` step 6.
  </Step>

  <Step title="Enter server IDs">
    Enter the server IDs.
    By default all channels of all servers/guilds in which the bot user is added will be indexed or processed.
  </Step>

  <Step title="Find server ID">
    To fetch server ID of a particular server,
    right click on the name of the server located on the top right corner and click on `Copy Server ID`
  </Step>

  <Step title="Enter channel names">
    Enter the channel names. By default all channel names under the server(s)
    from step 3 that the bot user has access to will be indexed or processed.
  </Step>

  <Step title="Find channel name">
    To get the channel name, hit on the settings icon next to the channel name.
    You will find the channel name in the `Overview` section
  </Step>

  <Step title="Optional Start Date">
    Optionally you can set a `Start Date` in the format of `YYYY-MM-DD`.
    Only messages after this date will be indexed or processed.
  </Step>
</Steps>
