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

# Discord

> Deploy your Eden agent to Discord servers

<Info>
  Deployments are experimental and currently in private beta. If you're interested in testing it now, please reach out to the devs on [Discord](https://discord.com/invite/4dSYwDT).
</Info>

Users who have been granted access to the deployment beta will notice a "Deployments" section in each Agent's settings.

## Setup Process

<Steps>
  <Step title="Create Discord Application">
    ### Create application in Discord

    Go to the [Discord Developer Portal](https://discord.com/developers/applications) and create a new application.

    <img src="https://mintcdn.com/eden-47189371/6FGXDw5FXvMGC_lQ/img/discord1.jpg?fit=max&auto=format&n=6FGXDw5FXvMGC_lQ&q=85&s=332f45c4dc201324a374966f0ac74a70" alt="Select 'New Application'" width="941" height="279" data-path="img/discord1.jpg" />

    Give your application a name (e.g. "My Agent") and click "Create". For convenience, use the same name as your agent.

    In "General Information":

    * Upload your agent's profile image to App Icon
    * Click 'Save' to save the changes

    <img src="https://mintcdn.com/eden-47189371/6FGXDw5FXvMGC_lQ/img/discord2.jpg?fit=max&auto=format&n=6FGXDw5FXvMGC_lQ&q=85&s=0836a7d352f7ae156057529f099c7526" alt="Discord deployment settings" width="938" height="579" data-path="img/discord2.jpg" />

    ### Configure Bot Settings

    1. Click "Bot" on the left sidebar
    2. Click "Reset Token" to generate a new token and copy it somewhere safe

    <img src="https://mintcdn.com/eden-47189371/6FGXDw5FXvMGC_lQ/img/discord3.jpg?fit=max&auto=format&n=6FGXDw5FXvMGC_lQ&q=85&s=7e1e5045f09bf2d92dde4ddc3851a598" alt="Generate and copy token" width="947" height="813" data-path="img/discord3.jpg" />

    <Warning>
      If you ever reset or revoke the token, your bot will stop working. You can always generate a new token and paste it again into Eden.
    </Warning>

    3. Scroll down to "Privileged Gateway Intents" and enable:
       * Presence Intent
       * Server Members Intent
       * Message Content Intent

    Click "Save Changes" after enabling these permissions.

    <img src="https://mintcdn.com/eden-47189371/6FGXDw5FXvMGC_lQ/img/discord/_100003.jpg?fit=max&auto=format&n=6FGXDw5FXvMGC_lQ&q=85&s=55bad32b0c4371782724a984ad430ef6" alt="Gateway Intents" width="1858" height="929" data-path="img/discord/_100003.jpg" />
  </Step>

  <Step title="Link Bot to Eden Agent">
    ### Configure Eden Deployment

    Go to your agent's deployment settings in Eden:

    1. Select Discord
    2. Paste the Discord Token you copied earlier

    <img src="https://mintcdn.com/eden-47189371/6FGXDw5FXvMGC_lQ/img/discord_deployment.jpg?fit=max&auto=format&n=6FGXDw5FXvMGC_lQ&q=85&s=aa5fd4202f4fc5a8629c1d731361b7e5" alt="Discord deployment configuration" style={{width: '80%'}} width="665" height="480" data-path="img/discord_deployment.jpg" />

    ### Set Up Allowed Channels

    You need to set up specific channels that your bot is allowed to access. The 'Allowed Channels' field is a list of channels your agent will be able to read and post to, and 'Read Access' is a list of channels your agent will be able to read from (but not post to).

    The note field is a description of the channel that would be helpful for you to give to your agent to tell it where to read or post. A good note is something like "AI Server - General Chat", "Company Server - Marketing Channel", etc.

    <img src="https://mintcdn.com/eden-47189371/1gSRhm2DT6kO10__/img/discord/discord3.jpg?fit=max&auto=format&n=1gSRhm2DT6kO10__&q=85&s=8e0d1983e83e78d538b6c5dc5fb2e728" alt="Discord deployment channels" style={{width: '80%'}} width="1792" height="1310" data-path="img/discord/discord3.jpg" />

    To find the channel IDs, first, enable Developer Mode in Discord:

    <Tabs>
      <Tab title="Step 1: Open Settings">
        <img src="https://mintcdn.com/eden-47189371/6FGXDw5FXvMGC_lQ/img/discord/_100001.jpg?fit=max&auto=format&n=6FGXDw5FXvMGC_lQ&q=85&s=5decbc21caa4f50d5538f98bb5a1a932" alt="User settings" style={{width: '40%'}} width="728" height="200" data-path="img/discord/_100001.jpg" />
      </Tab>

      <Tab title="Step 2: Enable Developer Mode">
        Search for "developer" and activate developer mode in advanced settings:

        <img src="https://mintcdn.com/eden-47189371/6FGXDw5FXvMGC_lQ/img/discord/_100002.jpg?fit=max&auto=format&n=6FGXDw5FXvMGC_lQ&q=85&s=39474246e8cfc1bc03430cd4911c8e53" alt="Developer mode" width="2140" height="468" data-path="img/discord/_100002.jpg" />
      </Tab>
    </Tabs>

    To add channels:

    1. Right-click any channel name in Discord
    2. Select "Copy Channel ID"
    3. Add the ID to "Allowed Channels" in Eden
    4. Add a label for the channel so you remember it

    <img src="https://mintcdn.com/eden-47189371/6FGXDw5FXvMGC_lQ/img/discord/_100000.jpg?fit=max&auto=format&n=6FGXDw5FXvMGC_lQ&q=85&s=2a66389c3117a8295707b43213ecfa21" alt="Copy Channel ID" style={{width: '20%'}} width="378" height="900" data-path="img/discord/_100000.jpg" />

    Click "Deploy" when you're done.

    <Note>
      Alternatively, you can copy the channel URL, and the ID will be the last number in the URL. For example, if the URL is [https://discord.com/channels/111111111/1234567890](https://discord.com/channels/111111111/1234567890), the ID is 1234567890.
    </Note>
  </Step>

  <Step title="Add Bot to Server">
    After successful deployment:

    1. Copy the "Invite Bot to Server" link from Eden
    2. Paste it into a browser
    3. Select your server and add the bot

    <img src="https://mintcdn.com/eden-47189371/6FGXDw5FXvMGC_lQ/img/discord/discord1.jpg?fit=max&auto=format&n=6FGXDw5FXvMGC_lQ&q=85&s=7997e960d30c37208dae321b7032d968" alt="Invite link" width="1227" height="418" data-path="img/discord/discord1.jpg" />

    Your bot will show as "Online" in your Discord server sidebar when ready.

    <img src="https://mintcdn.com/eden-47189371/6FGXDw5FXvMGC_lQ/img/discord/discord2.jpg?fit=max&auto=format&n=6FGXDw5FXvMGC_lQ&q=85&s=0c4c246b8d5adb753528fd137747ebba" alt="Bot online status" style={{width: '40%'}} width="526" height="374" data-path="img/discord/discord2.jpg" />
  </Step>
</Steps>

## Testing Your Agent

Go to one of the allowed channels and mention your bot in a message. If it responds, you're all set!

## Using the Discord Tools

The following tools are available for your agent to use once it is deployed to Discord:

* `discord_post` - Post a message to a channel
* `discord_search` - Search for messages in a channel

You can use these in a conversation with your agent.

<img src="https://mintcdn.com/eden-47189371/1gSRhm2DT6kO10__/img/discord/discord4.jpg?fit=max&auto=format&n=1gSRhm2DT6kO10__&q=85&s=3adb46a88d4915b4fd72c77abdc9d111" alt="Discord tools" style={{width: '80%'}} width="1504" height="460" data-path="img/discord/discord4.jpg" />

## Troubleshooting

<AccordionGroup>
  <Accordion title="Bot not responding">
    Common issues:

    * Check the bot has "Send Messages" permissions in the channel
    * Verify the channel ID is in the allowed channels list
    * Ensure gateway intents are enabled
    * Ensure the bot shows 'online' in the channels you are trying to get it to respond in. If the bot does not show in the sidebar and online, it does not have access to the channel.
  </Accordion>

  <Accordion title="Private channel setup">
    For private channels, manually add the bot as a member:

    1. Right-click the channel and click "Edit Channel"

    <img src="https://mintcdn.com/eden-47189371/6FGXDw5FXvMGC_lQ/img/discord/_100004.jpg?fit=max&auto=format&n=6FGXDw5FXvMGC_lQ&q=85&s=7308710b1d546b272860a03a47bd89bb" alt="Edit channel" style={{width: '40%'}} width="359" height="476" data-path="img/discord/_100004.jpg" />

    2. Go to Permissions → Add Members → Add your bot

    <img src="https://mintcdn.com/eden-47189371/6FGXDw5FXvMGC_lQ/img/discord/_100005.jpg?fit=max&auto=format&n=6FGXDw5FXvMGC_lQ&q=85&s=4ef18388f866efb1251f6dfdb9a9be96" alt="Add permissions" style={{width: '90%'}} width="1087" height="1027" data-path="img/discord/_100005.jpg" />
  </Accordion>
</AccordionGroup>
