> For the complete documentation index, see [llms.txt](https://bunny-store.gitbook.io/bunny-store-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://bunny-store.gitbook.io/bunny-store-docs/bunny-black-market/how-to-install-discord-badger-api.md).

# How to install Discord Badger API

## **🔧 Setting Up Badger Discord API**

To use Discord role whitelisting in **Bunny Blackmarket**, you must correctly configure **Badger\_Discord\_API** with your **Guild ID**, **Bot Token**, and **Role List**.

This guide will walk you through the entire setup step-by-step.

***

### **📥 Download Badger Discord API**

You can download the API from GitHub:

➡️ [**https://github.com/JaredScar/Badger\_Discord\_API**](https://github.com/JaredScar/Badger_Discord_API)

Place the resource in your server’s `resources` folder and ensure it is started in your `server.cfg`.

***

### **🎥 Video Tutorial**

A full video guide is available here:

➡️ [**https://youtu.be/blOnyLfevw8?t=110**](https://youtu.be/blOnyLfevw8?t=110)

***

## **📘 Step 1 — Get Your Discord Guild ID**

1. **Log in** to your Discord account.
2. Go to\
   **Settings → Advanced → Enable Developer Mode**

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

3. Right-click your **server icon**.\
   ![](/files/4BTk3UXALDfxtSCARgTE)
4. Select **Copy Server ID and add into Discord\_Badger\_API/config.lua as showed in the screenshot**\
   ![](/files/xELlha4ynYs0W35nfhT6)

This is your **Guild ID**.

***

## **📘 Step 2 — Create & Configure Your Discord Bot**

Follow these steps on the **Discord Developer Portal**:

1. Visit:\
   [**https://discord.com/developers/applications**](https://discord.com/developers/applications)\
   ![](/files/rN93SD6iPylhrTpToFlg)
2. Click **New Application** and create a bot.\
   ![](/files/rKuqDIz6hiMSfr2tZFad)
3. Go to the **Bot** tab → click **Add Bot**.

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

4. Copy the **Bot Token** from the bot page and add into Discord\_Badger\_API/config.lua\
   ![](/files/mo76NH6Jrkect4BQCVIF)
5. Invite the bot to your server using the OAuth2 URL. Copy the url and paste into new tab of the browser

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

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

***

### **🔐 Add Your Bot Token & Guild ID to the Script**

Open **Badger\_Discord\_API/config.lua**, then replace:

```lua
Bot_Token = '{BOT_TOKEN}'
Guild_ID = '{GUILD_ID}'
```

with your actual values.

Example:

```lua
Bot_Token = 'NjI5MjQz...YOURTOKEN'
Guild_ID = '123456789012345678'
```

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

***

## **📘 Step 3 — Setup Discord Role List**&#x20;

Setting up the **RoleList** allows you to check for Discord roles in other Discord-based scripts (including Bunny Blackmarket).

#### **How to get role IDs:**

1. Go to your Discord server settings.\
   ![](/files/pN6JD5XC9ZAJ4gdiCTzv)
2. Open **Roles**.
3. Create any roles you want to use (Admin, Owner, Blackmarket Access, etc).
4. Right-click each role → **Copy Role ID**.

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

4. Add them to the `RoleList` in your `Discord_Badger_API/config.lua`:

```lua
RoleList = {
    ['owner'] = 'ROLE_ID_HERE',
    ['admin'] = 'ROLE_ID_HERE',
    ['blackmarket'] = 'ROLE_ID_HERE',
}
```

<figure><img src="/files/5iDevRmUbdSJPei5y39l" alt=""><figcaption></figcaption></figure>

Example:

```lua
RoleList = {
    ['owner'] = '112233445566',
    ['admin'] = '556677889900',
    ['blackmarket'] = '998877665544',
}
```

5. Now copy the role name from `Discord_Badger_API/config.lua` and paste into `bunny_blackmarket/config.lua:`

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

6. Restart Server.

***

## **✅ You’re Done!**

Once the bot token, guild ID, and roles are correctly set:

* Your bot can authenticate users.
* Bunny Blackmarket can check Discord roles.
* Whitelisting works instantly and securely.


---

# 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:

```
GET https://bunny-store.gitbook.io/bunny-store-docs/bunny-black-market/how-to-install-discord-badger-api.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.
