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

# Discord

> Connect MeepaGateway to Discord

Connects via the Discord Gateway v10 WebSocket.

## Prerequisites

1. A Discord application and bot token from the [Discord Developer Portal](https://discord.com/developers/applications)
2. **MESSAGE CONTENT** privileged intent enabled in the portal
3. The bot invited to your server with `Send Messages`, `Read Message History`, and `View Channels` permissions

### Invite URL

Replace `CLIENT_ID` with your application's client ID:

```
https://discord.com/api/oauth2/authorize?client_id=CLIENT_ID&scope=bot&permissions=68608
```

## Configuration

In `~/.meepagateway/agents/<id>/agent.yaml`:

```yaml theme={null}
connectors:
  - type: discord
    bot_token: "your-discord-bot-token"
    guild_ids: []  # empty = all guilds; set to ["guild_id"] to restrict
```

<ParamField path="bot_token" type="string" required>
  Discord bot token from the Developer Portal.
</ParamField>

<ParamField path="guild_ids" type="array" default="[]">
  Restrict the bot to specific guilds (servers). Empty means all guilds.

  **Example:** `["1234567890123456789"]`
</ParamField>

## Behavior

* Self-messages are filtered automatically (bot user ID from the `READY` event)
* Long responses are chunked at Discord's 2000-character limit
* Rate limit headers are respected with automatic retry (max 2 retries)
* Guild and channel metadata is tracked from `GUILD_CREATE` events

<Warning>
  The **MESSAGE CONTENT** privileged intent must be enabled in the Discord Developer Portal. Without it, the bot connects but receives empty message content.
</Warning>
