> For the complete documentation index, see [llms.txt](https://alhena.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://alhena.gitbook.io/docs/integrations/communication/integrating-alhena-ai-with-discord.md).

# Discord

Alhena AI enhances Discord communities by offering automated responses to user inquiries. It can learn from admin responses in Discord to further reduce the need to manually reply to user questions. Additionally, it allows users to get help from admins in a private one-on-one channel, integrating Alhena Ticketing.

## Setting Up The Discord Integration

To begin, go to the settings page and select "Connect" on the Discord section.

<figure><img src="/files/Cvs6PycZ1SIqQ0WDlnLk" alt=""><figcaption></figcaption></figure>

Next, you will be redirected to Discord's sign-in page. Here, you can log in and choose the server where you wish to add the bot.

<figure><img src="/files/WBoGjIydGFAaxOSttcbB" alt=""><figcaption></figcaption></figure>

After finishing this step, click on "Complete Setup" in the Alhena dashboard to set up your bot. If you ever want to uninstall the Discord integration, you can also do that from here by clicking on the toggle.

<figure><img src="/files/UQr07aFTzI5ylaaQZLZU" alt=""><figcaption></figcaption></figure>

## Configuring The Discord Integration

On the Discord settings page, you'll see the following settings:

<figure><img src="/files/ARubANSqNifR4uA2AIK5" alt=""><figcaption></figcaption></figure>

### AI Agent Customization

Set the display name of your bot that users will see in Discord.

### Automated Reply Channels

Your bot will look for an answer for any questions in the channels you configure here, and if it's able to answer, it will reply to them as a new thread. If the bot can't find an answer, it won't reply unless it's explicitly mentioned in the message, leaving it up the admins of the server to reply.

Alhena can learn from these human responses, so admins don't have to keep answering the same questions.

Users can then ask followup questions in the thread, keeping in mind the previous messages in the conversation.

### Ticket Creation Channel

This section will allow you to configure Discord with Alhena Ticketing. Users will be able to directly contact a member of your team in a private channel, where team members can then reply from the Alhena Dashboard.

<figure><img src="/files/Z1nzshORcyTyP6LIkDHI" alt=""><figcaption></figcaption></figure>

Here you can customise the appearance and text shown to users. When a user clicks "Create Ticket", a new channel will be opened that only they can see and will receive replies in. You can provide a link to your website that may be helpful to your users, which will be opened when they click the message.

Once you've selected a ticket creation channel, the message settings appear, letting you customise the panel shown to users:

* **Message Title** — the heading of the ticket message panel.
* **Message Description** — the body text shown to users.
* **Message URL** — a link that opens when a user clicks the message.
* **Button Label** — the text shown on the ticket button.
* **Message Color** — the accent colour of the message panel.

A live "Preview of the Discord message panel" updates alongside these fields so you can see how the panel will appear to users before saving.

### Ticket Notification Channel

This is a channel in Discord for admins to be notified when a new ticket is created. You can set up a private channel in Discord that only admins have access to, and then configure it here. Whether your users create a ticket through Discord, or other channels such as email and website chat, admins will receive notifications here, so new tickets don't go unnoticed and your users can get a response as quickly as possible.

<figure><img src="/files/1Wf7xPI45lfXalZTZ9Q7" alt=""><figcaption></figcaption></figure>

## Training Your Bot On Admin Responses

You can train your bot on messages from select users in your Discord server. Admins may leave helpful information not found on your website or other sources, and your bot can eliminate the need for them to repeat these responses.

When users ask questions in your configured Automated Reply Channels, Alhena will attempt to find an answer in any of the pages and documents you've provided for training. However, there are times when it won't find an answer and a human needs to manually replies to these questions.

You can configure Alhena to learn from these human responses on the Bot Settings page. If you've already connected to Discord as described above, then the same server will be used here.

<figure><img src="/files/Ku2XBycDy70Z0HXM7EMN" alt=""><figcaption></figcaption></figure>

You can then select which channels you'd like Alhena to learn from, and which Discord users should be considered.

<figure><img src="/files/vAY4Q74r4zCO5f9XbmRw" alt=""><figcaption></figcaption></figure>

After you save your settings, Alhena will automatically start fetching messages from Discord and adding them to your bot's knowledge base. It will continuously fetch any new messages without you needing to manually retrain the bot. This may initially take up to a few days if you have many messages, but you can see the status of the data ingestion on the Bot Settings page once Discord training is configured.

<figure><img src="/files/8ZznQKDMRZvQsEuAtvNO" alt=""><figcaption></figcaption></figure>

The bot will automatically learn from any new messages as they come in. Please note that it may take up to an hour for the bot to ingest any newly added messages.

## Bot Profile Mapping

If you have multiple bot profiles set up in Alhena with different knowledge bases (such as one for developers, one for regular users), then you can set up multiple channels in Discord that each use a different bot profile.

This feature currently requires manual setup on Alhena's end. Please [contact support](/docs/troubleshooting/troubleshooting.md#contact-support) if you'd like to map your Discord channels to different bot profiles.

## FAQs

### Why did my bot not respond to a question asked in Discord?

Alhena will automatically try to answer any questions in channels you've configured it for. There are a couple of reasons why it might not reply. If it couldn't find an answer in your knowledege base, it won't reply unless directly mentioned. If an admin jumps in to the thread where the bot is answering, it will stop replying and let the admin take over.

### Why did the bot not respond to my question in Discord?

Alhena will attempt to find an answer to any question asked in the configured automated reply channels. If your bot couldn't find an answer in your knowledge base, it won't reply unless you directly mention the bot. If an admin jumps into the thread where a bot is answering, it will also stop replying.

### I see a "Missing Permissions" error when saving my channels

When you save, Alhena checks that it has messaging permissions in the channels you selected. If it lacks access to any of them, a **Missing Permissions** dialog appears letting you know Alhena can't message in some of your chosen channels. You can either select different channels, or update Alhena's permissions (for example to [add the bot to private channels](https://alhena.ai/support-articles/adding-discord-bot-to-private-channels)). Remember to hit "Save" again after making any adjustments.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://alhena.gitbook.io/docs/integrations/communication/integrating-alhena-ai-with-discord.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
