# Discord

> Step-by-step guide to integrating your Quickchat AI Agent with Discord. Create a bot, configure permissions, and go live on your server.

In this guide, we'll go through how to integrate your AI Agent into your Discord server. Here's an overview of what we'll cover:

1. Create a Discord server
2. Create a Discord application
3. Configure Your Discord Application
4. Add the Bot to Your Discord Server
5. Integrate your Discord bot with Quickchat AI

## Watch the Video

[Watch on YouTube](https://www.youtube.com/watch?v=tNXuqBUZZ-4)

## Creating and configuring a Discord Server

### Create a Discord Server

To initiate the integration process, you'll need a Discord Server. If you don't have a Discord account, visit [discord.com](https://discord.com) and create one. Once logged in, follow [this guide to create your Discord server](https://support.discord.com/hc/en-us/articles/204849977-How-do-I-create-a-server-).

### Create a Discord Application

Go to [discord.com/developers/applications](https://discord.com/developers/applications) while logged in to your Discord account and create a new application.

### Configure Your Discord Application

Before adding your bot to the server, enable the **Message Content Intent** for your application. This allows your bot to read messages sent by users on your server.

![Quickchat AI Interface](https://docs.quickchat.ai/_astro/message-intent.NVnNJZhz.png)

### Add the Bot to Your Discord Server

Now you need to add your bot to your server. The way to do it is to construct a Discord URL and paste it into your browser:

```
https://discord.com/api/oauth2/authorize?client_id=<YOUR CLIENT ID>&permissions=309237712896&scope=bot
```

**Where does the permissions number come from?**

The permissions number (`309237712896`) comes from requesting the following permissions:

- `Send Messages`
- `Create Public Threads`
- `Send Messages in Threads`
- `Read Message History`

Those are the minimal set of permissions required for your bot to operate correctly. You can see it for yourself by going to [discord.com/developers/applications](https://discord.com/developers/applications), selecting your application, clicking on **Bot** on the left and scrolling down:

![Your discord bot permissions](https://docs.quickchat.ai/_astro/permissions-integer.D-K4GVRL.png)

**Where to find YOUR CLIENT ID?**

The easiest way will be to look at the address bar in your browser and copy the long number which is part of the address:

```
https://discord.com/developers/applications/<YOUR CLIENT ID>/bot
```

![Your client ID](https://docs.quickchat.ai/_astro/client-id.Z-Mljq23.png)

In this case the client id is **1234567890123456789** which means that the full URL you need to go to to add the server will be:

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

## Integrate Your Discord Bot with Quickchat AI

To connect your bot with **Quickchat AI**, retrieve your **Discord Bot Token** from the [Developer Portal](https://discord.com/developers/applications).

1. Go to **Bot Settings** → **Reset Token** → **Copy Token**

![Reset token](https://docs.quickchat.ai/_astro/reset-token.OEKpvVuf.png)

2. In the **Quickchat AI Dashboard**, head to **External Applications**, enable the **Discord Bot Integration** and paste your token.

![Paste token](https://docs.quickchat.ai/_astro/paste-token.heB4K_lh.png)

## 🎉 Your AI Bot is Live!

Head back to **Discord** - your bot should be **online** and ready to chat! Just **@mention** it to start a conversation. 🤖💬

![Bot active](https://docs.quickchat.ai/_astro/bot-active.CoUvIYHf.png)

When **@mentioned**, the bot will reply to users in a thread. Users can continue the conversation inside the thread without mentioning the bot.

![Conversation in thread](https://docs.quickchat.ai/_astro/conversation-in-thread.DrEOnyKG.png)

---

Join our Discord server to learn more about how to make the most of Quickchat AI 👉 [discord.gg/KqkHwvPRNH](https://discord.gg/KqkHwvPRNH)
