# Discord Bot

This integration allows you to:

* Sync your community between ImperialCAD and Discord.
* Control access with features like auto-join and auto-kick.
* Provide members with seamless roleplay and CAD access tools inside Discord.

> ⚡ Available on **Standard+ plans and above**.

***

### 📖 Setup/Install Guide

#### Step 1: Open Integrations

* From the **Admin Panel**, navigate to **Settings → Integrations**.
* Under **Discord**, click **Add Bot to Discord**.

***

#### Step 2: Authorize the Bot

* You’ll be redirected to Discord’s authorization page
* Select the server you want to add **ImperialBot** to
* Ensure you have **Manage Server** permissions
* Click **Continue** and then **Authorize**

***

#### Step 3: Run Setup Command & Link Community

* Inside your Discord server, an **Administrator** must run:

```
/setup
```

* You’ll be prompted to enter your **ImperialCAD Community ID** and **API Key**
* These values are available in your CAD under **Settings → API**
* After submitting the values, ImperialBot will sync your Discord guild with your ImperialCAD community

***

#### Step 4: Configure Integration

Once linked, the invite button in your Admin Panel will disappear, and integration settings will appear.

You can now toggle:

* **Auto-Kick** → Automatically removes members from your community when they leave your Discord server, if their ImperialCAD account is verified.
* **Auto-Join** → Allows members who join your Discord server to automatically join your ImperialCAD community, If both are opted in.

***

### ⚠️ Troubleshooting

* **Bot won’t join?** Ensure you have *Manage Server* permissions in Discord
* **/setup not working?** Make sure the command is run by a *Discord Administrator*
* **Community not linking?** Double-check your **Community ID** and **API Key** from the API settings page

If issues persist, Contact support.


---

# 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.imperialcad.app/api-and-integrations/discord-bot.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.
