# BadgerStaffPanel

## Setting up BadgerStaffPanel

### Discord Application Configuration

```
<?php
$clientID = '{CLIENT-ID}';
$clientSecret = '{CLIENT-SECRET}';
$redirect_URI = '{REDIRECT-URI}';
$guildID = '{GUILD-ID}';
$discordRedirectAuth = '{DISCORD-REDIRECT-AUTH}';
$botToken = '{BOT-TOKEN}';
```

* Navigate to <https://discordapp.com/developers/applications>&#x20;

![](/files/-M8awBzyaivJ6t-efycK)

* Click on `New Application` then name the bot what you would like

![](/files/-M8awzQ3tntAjLIELGBT)

* Click `Copy` under the `Client ID` on the page. Then replace `{CLIENT-ID}` within the `config.php` file
* Click `Copy` under the `Client Secret` on the page. Then replace the `{CLIENT-SECRET}` within the `config.php` file
* Click on `OAuth2` within the side navigation bar
* Add your website's URL as a redirect, for example we will use `http://localhost` for a locally hosted website
* You will then want to generate a discord authorization link
* To do this, navigate down to the `OAuth2 URL Generator` section, then select our `http://localhost` redirect URL
* Now we choose the options we need for the authorization URL, select `identify`, `email`, and `guilds`&#x20;

![](/files/-M8ayXzGTESVnZ6ZiBJn)

* Now you will want to click the `Copy` button and copy the huge link that has been generated
* Now we go back into our `config.php` file again

```
$redirect_URI = '{REDIRECT-URI}';
$guildID = '{GUILD-ID}';
$discordRedirectAuth = '{DISCORD-REDIRECT-AUTH}';
$botToken = '{BOT-TOKEN}';
```

* You now want to submit `http://localhost` where `{REDIRECT-URI}` is located
* You then want to submit the huge link you copied in the previous step and replace `{DISCORD-REDIRECT-AUTH}` with it
* You now need to get the guild ID of your discord server
* You will first turn on the developer mode in Discord to be able to do this (check below GIF)

![](https://i.gyazo.com/c6306c90a976361e2e1e3d4fc09f4d21.gif)

* Now you will need to copy your server's guild ID (check below GIF)

![](https://i.gyazo.com/0da39238b6975994e1c7272755a7ca0c.gif)

* Now replace `{GUILD-ID}` with the guild ID you just got through your discord application
* We now need to create a discord bot, navigate to `Bot` on the side navigation
* Create the discord bot, confirm creating it
* Now, click `Copy` and get the discord bot token
* Replace`{BOT-TOKEN}` within the `config.php` file with the token you had just copied
* Invite the discord bot to your server now by going to the `OAuth2` on the side navigation

![](/files/-M8b0KKHRVqKZFz4i9C_)

* Click `Copy` and then enter the URL in a browser, then invite this bot to your discord server
* You have now completed the discord application configuration section of BadgerStaffPanel&#x20;

### Server API Configuration

```
$serverIP = '{SERVER-IP}';
$port = 80; // Website port
$steamAPIkey = '{STEAM-API-KEY}';
$server_port = 30120;
$rconPassword = '{RCON-PASSWORD}';
$serverName = '{SERVER-NAME}';
```

* Replace `{SERVER-IP}` with the server IP of your server
* Replace `80` with the port your website runs on (for most websites, the default port is port 80)
* Replace `{STEAM-API-KEY}` with the steam API key you get from a key you get from <https://steamcommunity.com/dev/apikey>
* Replace `30120` with the port of your FiveM server (for most servers, the default port is 30120)
* Replace `{RCON-PASSWORD}` with the RCON password within your `server.cfg` file&#x20;
* Replace `{SERVER-NAME}` with your server's name
* You have now completed the server API configuration section of BadgerStaffPanel

### SQL Configuration

```
// SQL INFO
$host = '';
$username = '';
$password = '';
$db = '';
$port = 3306;
```

### Website Permissions Configuration

```
$permissionsSetup = [
    '{T-MOD-RANK}' => [// Start T-Mod
        'Permission.Note',
        'Permission.Warn',
        'Permission.Kick',
        'Permission.RemoveNote',
        'Permission.RemoveWarn',
    ], // End T-Mod
    '{MOD-RANK}' => [// Start Mod
        'Permission.Note',
        'Permission.Warn',
        'Permission.Kick',
        'Permission.Tempban',
        'Permission.Ban',
        'Permission.RemoveNote',
        'Permission.RemoveWarn',
        'Permission.RemoveKick',
        'Permission.RemoveTempban',
    ], // End Mod
    '{ADMIN-RANK}' => [ // Start Admin
        'Permission.Note',
        'Permission.Warn',
        'Permission.Kick',
        'Permission.Tempban',
        'Permission.Ban',
        'Permission.RemoveNote',
        'Permission.RemoveWarn',
        'Permission.RemoveKick',
        'Permission.RemoveTempban',
        'Permission.RemoveBan',
    ], // End Admin
    '{MANAGEMENT-RANK}' => [ // Start Management
        'Permission.Note',
        'Permission.Warn',
        'Permission.Kick',
        'Permission.Tempban',
        'Permission.Ban',
        'Permission.RemoveNote',
        'Permission.RemoveWarn',
        'Permission.RemoveKick',
        'Permission.RemoveTempban',
        'Permission.RemoveBan',
    ], // End Management
];
```

* Replace `{T-MOD-RANK}` with the role ID of the T-Mod rank in your discord server
* Replace `{MOD-RANK}` with the role ID of the Mod rank in your discord server
* Replace `{ADMIN-RANK}` with the role ID of the Admin rank in your discord server
* Replace `{MANAGEMENT-RANK}` with the role ID of the Management rank in your discord 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.badger.store/badger-software/badgerstaffpanel.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.
