# Discord

This agent enables communication between Katara and a Discord server, allowing Katara to read and write messages. Currently, Discord agents are used in the [Community Support workflow](/about/workflows/questions-and-answers-q-and-a.md) to enable responding to questions in Discord servers.

## Registering a Discord agent in your server

When creating a Discord agent or adding an existing Discord agent to a server, you will need to follow these steps:

1. Install the Katara app on your server. You will be given a link for this. The installed app will need [the permissions listed below](#what-permissions-does-the-agent-need).
2. Register the agent in your server with the `:katara.register` command. You will be given a one-time password for registration. **NOTE**: The agent will be enabled by default in the channel you register in. You will be able to change this in the agent's configuration.
3. Verify that the agent has been registered. You should see a confirmation message from the bot and see that the server was registered successfully by verifying the registration on the same screen the other steps were given.

## What permissions does the agent need?

For the Discord agent to run as expected, it needs the permissions below. [Don't know how to access your server's permission settings?](https://support.discord.com/hc/en-us/articles/214836687-Discord-Roles-and-Permissions)

### Server permissions

You will need to give the `katara` role these server permissions:

General Server Permissions: **View Channels** and **Manage Channels**

<div align="left"><figure><img src="/files/y5EpDHqSQtQOOoWXd5Jm" alt=""><figcaption></figcaption></figure></div>

Text Channel Permissions: **Send Messages**, **Send Messages in Threads**, **Create Public Threads**, **Create Private Threads**, **Embed Links**, **Attach Files**, **Add Reactions**, **Manage Messages**, **Manage Threads**, and **Read Message History**

<div align="left"><figure><img src="/files/fAywbsjl74NNcg6k9Jjh" alt=""><figcaption></figcaption></figure></div>

### Channel permissions

{% hint style="info" %}
You only need to adjust a channel's permissions if you've overridden the server permissions above or if the channel is private. By default, the channel's permissions will be inherited directly from the server-level permissions.
{% endhint %}

For every channel the agent is active in, the `katara` role will need the same permissions [as listed above](#server-permissions). You can change channel-level permissions by hovering on a channel, clicking **Edit Channel > Permissions > Advanced permissions**.[ Learn more about Discord channel permissions](https://support.discord.com/hc/en-us/articles/10543994968087-Channel-Permissions-Settings-101)

## Agent configuration

### Tags

Tags are applied to all future data collected by this agent, which can be used later for filtering. All servers and channels inherit these tags.

### Ignored roles

Messages from users with these roles will be ignored by the agent. All servers and channels inherit these ignored roles.

## Channel configuration

### Enabled

Whether to collect data from a channel. By default, all channels except the channel you register the agent in will be disabled.

### Send replies

Enabling this option allows you to respond to questions asked in your Discord. If you don’t provide one, we’ll just collect messages into your corpus.

### Q\&A Agent

If sending replies, this option allows you to choose which Q\&A Agent will generate the replies. This agent can then be configured to configure responses in your channel.

### Send replies when threshold is not met

If enabled, users will be notified when the linked Q\&A agent is not able to generate a response to a question that meets its confidence threshold.

### Tags

Tags are applied to all future data collected by this channel, which can be used later for filtering. Tags set in the agent's configuration will be inherited here.

## Commands

Commands can be typed into your Discord server once you've installed the Katara bot.

### :katara.register \<one\_time\_password>

Register an agent in your server using a password generated when creating an agent. **NOTE**: The agent will be enabled by default in the channel you register in. You will be able to change this in the agent's configuration.

### :katara.config

Print configuration information. You can use this command to ensure the Agent is connected to your channel as expected.

### :katara.load

Load all messages in a channel into the Katara platform.

### :katara.ask \<question>

Ask the agent a question, even if it's disabled in the channel. This will not produce an answer if you do not have a Q\&A agent attached to the Discord agent.

### :katara.hello

Returns "Hi." You can use this command to ensure that the Katara bot has been correctly added to your server.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.katara.ai/about/agents/conversational/discord.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
