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

# Discord

> Connect a Discord bot to your ArgentOS agent for server and DM interactions.

## Overview

ArgentOS supports Discord as a channel, allowing your agent to interact in server channels and direct messages. The bot uses Discord's Gateway (WebSocket) for real-time events and the REST API for sending messages.

## Prerequisites

* A Discord account
* A Discord server where you have **Manage Server** permissions
* ArgentOS gateway running

## Setup

<Steps>
  <Step title="Create a Discord Application">
    1. Go to the [Discord Developer Portal](https://discord.com/developers/applications)
    2. Click **New Application** and give it a name
    3. Navigate to the **Bot** section
    4. Click **Reset Token** and copy the bot token
  </Step>

  <Step title="Configure Intents">
    In the Bot section, enable these **Privileged Gateway Intents**:

    * **Message Content Intent** -- required to read message text
    * **Server Members Intent** -- optional, for member lookups
    * **Presence Intent** -- optional, for online status
  </Step>

  <Step title="Invite the Bot">
    1. Go to **OAuth2 > URL Generator**
    2. Select scopes: `bot`, `applications.commands`
    3. Select permissions: `Send Messages`, `Read Message History`, `Embed Links`, `Attach Files`
    4. Copy the generated URL and open it in your browser
    5. Select your server and authorize
  </Step>

  <Step title="Add the Channel">
    ```bash theme={null}
    argent channels add discord
    ```

    Paste your bot token when prompted.
  </Step>
</Steps>

## Configuration

```json theme={null}
{
  "channels": {
    "discord": {
      "enabled": true,
      "token": "your-discord-bot-token",
      "intents": ["GUILDS", "GUILD_MESSAGES", "DIRECT_MESSAGES", "MESSAGE_CONTENT"],
      "allowedGuilds": [],
      "allowedUsers": [],
      "channelScope": "collapsed"
    }
  }
}
```

### Channel Scope

The `channelScope` option controls how Discord channels map to agent sessions:

| Mode            | Behavior                                                |
| --------------- | ------------------------------------------------------- |
| `"collapsed"`   | All channels in a guild share one session (default)     |
| `"per-channel"` | Each channel gets its own session with separate context |

## Supported Features

| Feature              | Supported |
| -------------------- | --------- |
| Text messages        | Yes       |
| Embeds               | Yes       |
| File attachments     | Yes       |
| DMs                  | Yes       |
| Server channels      | Yes       |
| Slash commands       | Planned   |
| Voice channels       | No        |
| Message history read | Planned   |
