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

# Discord

> Connect Sutando to Discord so it can DM you, post on your behalf, and answer @mentions in server channels.

About 5 minutes. You create a Discord bot, paste its token into AG2 Space and invite the bot to a server.

## Before you start

* A Discord account.
* **A Discord server, even one just for you.** Discord requires a bot and a user to share at least one server before they can DM each other. Create one with **+ → Create My Own → For me and my friends**.
* AG2 Space installed and signed in on your Mac ([desktop.ag2.space](https://desktop.ag2.space)).

**1. Create the Discord application**

In the [Discord Developer Portal](https://discord.com/developers/applications) click **New Application** and name it. The name is a private label.

**2. Add a bot user and its intents**

Sidebar → **Bot**. Under **Privileged Gateway Intents** turn on **Server Members Intent** and **Message Content Intent**, then **Save Changes**.

**3. Copy the bot token into AG2 Space**

On the Bot page click **Reset Token** (Discord shows the token only after a reset), confirm and **Copy**.

In AG2 Space open **Settings → Channels**, paste it into **Discord bot token** and click **Save** at the bottom. Once saved, the field shows a green **running** badge. The token is stored locally on your Mac.

> [!WARNING]
>
> The bot token grants full access to your bot. Do not paste it into chats, screenshots or commits.

**4. Invite the bot to your server**

Sidebar → **OAuth2 → URL Generator**. Under **Scopes** check **bot**; under **Bot Permissions** check at least **View Channels**, **Send Messages**, **Read Message History**, **Attach Files** and **Embed Links**. Open the generated URL, pick the server and **Authorize**.

**5. Verify**

The bot appears in the server's member list with a green dot. DM it "hello"; your agent should reply within a few seconds.

## Troubleshooting

> [accordion] The bot shows offline or never replies
>
> AG2 Space must be running on your Mac: the agent lives in it and Discord forwards messages to it. If the app is running, the token may have been reset on Discord's side; reset it again, copy and paste the new one, Save.

> [accordion] Replies in DM but not in server channels
>
> In channels the bot replies only when @mentioned directly, so it does not answer every message in a busy channel.

> [accordion] "Privileged Intents required" in the Sutando logs
>
> Turn on Server Members and Message Content intents (step 2), save, then restart AG2 Space.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.