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

![](https://4135746405-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3gpAFypb73zWIFfO7w%2F-M8MLWCbKZILy0gvRu7Z%2F-M8awBzyaivJ6t-efycK%2Fimage.png?alt=media\&token=889fea96-c313-47b7-aea9-2bba14c21ebc)

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

![](https://4135746405-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3gpAFypb73zWIFfO7w%2F-M8MLWCbKZILy0gvRu7Z%2F-M8awzQ3tntAjLIELGBT%2Fimage.png?alt=media\&token=030623e7-32b7-4d6c-b3d3-1199b3d056af)

* 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;

![](https://4135746405-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3gpAFypb73zWIFfO7w%2F-M8MLWCbKZILy0gvRu7Z%2F-M8ayXzGTESVnZ6ZiBJn%2Fimage.png?alt=media\&token=63af8d6a-eae5-41fb-b7a9-26a7f99531ea)

* 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

![](https://4135746405-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M3gpAFypb73zWIFfO7w%2F-M8MLWCbKZILy0gvRu7Z%2F-M8b0KKHRVqKZFz4i9C_%2Fimage.png?alt=media\&token=33163437-eb4d-49b2-8e8f-c5aaee83d711)

* 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
