# Connecting Nairi to Discord

Install the Nairi Discord bot, route channel messages to an agent, and watch tasks run in threads.



This page walks through installing the Nairi bot into a Discord guild, binding a channel to one of your agents, and sending your first prompt.

## Prerequisites [#prerequisites]

* **Manage Server** permission on the Discord guild you want to install the bot into.
* At least one agent in your Nairi org. If you haven't created one, run through the [Quickstart](/help/getting-started/quickstart) first.

## Step 1 — Install the Nairi Discord bot [#step-1--install-the-nairi-discord-bot]

In the dashboard, open **Settings → Integrations**. Find the **Chat Platforms** section, click **Connect**, then pick **Discord** from the dropdown.

You'll be redirected to Discord's standard "Add to Server" flow. Pick the server you want, leave the permissions checked as-is, and approve. Nairi asks for exactly four permissions:

| Permission                | Why                                                                                                    |
| ------------------------- | ------------------------------------------------------------------------------------------------------ |
| **Send Messages**         | Reply in channels and threads.                                                                         |
| **Add Reactions**         | Show task status on your message (`👀` working, `⏳` queued, `✅` done, `✋` waiting on you, `❌` failed). |
| **Attach Files**          | Send files back into the thread when a task produces them.                                             |
| **Create Public Threads** | Open a fresh thread for each new task so the channel stays readable.                                   |

After you authorize, Discord redirects to a Nairi confirmation page, then drops you back on **Settings → Integrations** with the new guild listed under **Chat Platforms**.

You can install the bot into more than one Discord guild per Nairi org. Each connected guild shows in the list with its name, the date it was connected, and a disconnect button on hover.

## Step 2 — Make sure the bot can post in your channel [#step-2--make-sure-the-bot-can-post-in-your-channel]

The bot inherits Discord's normal role and channel permission model — installing it in the guild doesn't grant blanket access to every channel. If the target channel is private, or if your guild restricts the `@everyone` role, give the Nairi role (or the `@Nairi` member directly) **View Channel**, **Send Messages**, **Create Public Threads**, and **Add Reactions** on that channel.

DMs to the bot are **not supported**. The bot only responds to mentions inside a guild channel.

## Step 3 — Bind the channel to an agent [#step-3--bind-the-channel-to-an-agent]

Channel-to-agent binding is done from **inside Discord**, not from the dashboard. The dashboard's Connected Channels view is read-only and only shows bindings that already exist.

In the channel you want to bind, list your agents:

```
@Nairi -cmd agents
```

The bot replies with the agents in your org and their IDs. Then bind the channel:

```
@Nairi -cmd agent=<agent-id>
```

That channel will now route every `@Nairi` mention to the selected agent until you switch it again.

* One channel can be bound to **one agent at a time**. Re-running `-cmd agent=` overwrites the previous binding.
* One agent can be bound to **any number of channels**, across one or many guilds.

The full `-cmd` reference (modes, list-running-tasks) lives in [Configure in Discord](/help/configuring-the-agent/discord).

## Step 4 — Send your first prompt [#step-4--send-your-first-prompt]

Mention the bot at the start of a message in the bound channel:

```
@Nairi find any failing tests in the last day's CI runs
```

What happens next:

1. The bot adds `👀` to your message to confirm it was received.
2. It creates a new public thread off your message, named `CC Sesh #NNNN` (a random 4-digit suffix). All subsequent task output goes into that thread.
3. The agent's reply streams in as it works.
4. The status reaction is updated as the task progresses: `⏳` queued behind another task, `👀` working, `✋` waiting on your input, `✅` done, `❌` failed.

If you mention the bot from inside an existing thread instead of from the channel root, the reply stays in that thread instead of opening a new one.

The full transcript also shows up in **Tasks** in the dashboard.

## File attachments [#file-attachments]

Attachments work in both directions:

* **To the agent**: upload files into the channel message (or thread) along with your prompt. The bot reads them as part of the input — useful for screenshots, logs, CSVs, or any file you want the agent to look at.
* **From the agent**: when a task produces a file, the bot posts it back into the thread.

## Concurrency and queueing [#concurrency-and-queueing]

The number of tasks an agent can run in parallel is governed by its **instance count**. If a new message arrives while every instance is busy:

* The bot reacts with `⏳` instead of `👀`.
* The task waits in the queue.
* As soon as an instance frees up, the queued task starts and the reaction switches to `👀`.

No tasks are dropped. See [Where and how your agent runs](/help/building-agents/runtime) for tuning instance count.

## Removing the integration [#removing-the-integration]

To unbind a single channel without uninstalling Discord, point it at a different agent inside the channel:

```
@Nairi -cmd agent=<different-agent-id>
```

To remove Discord entirely, do **both** of the following:

1. **In the dashboard:** Settings → Integrations → hover the guild row → click the unplug icon. Confirm in the **Disconnect Discord Server** dialog. This deletes the integration and cascades all channel bindings. Past task transcripts in **Tasks** stay visible.
2. **In Discord:** Server Settings → Integrations → Nairi → **Kick**. This removes the bot from the guild.

Discord does not notify Nairi when the bot is kicked from a guild, so doing step 2 alone leaves a stale integration record in the dashboard. Always do step 1 too.

## Related [#related]

* [Configure in Discord](/help/configuring-the-agent/discord) — full `-cmd` command reference and per-channel settings.
* [In Slack & Discord](/help/communicating-with-agents/slack-and-discord) — how to chat with the agent once installed.
* [Where and how your agent runs](/help/building-agents/runtime) — tuning instance count and concurrency.

***

*Can't find what you're looking for? Email [support@nairi.ai](mailto:support@nairi.ai).*
