Badger Docs
Search…
BadgerStaffPanel

Setting up BadgerStaffPanel

Discord Application Configuration

1
<?php
2
$clientID = '{CLIENT-ID}';
3
$clientSecret = '{CLIENT-SECRET}';
4
$redirect_URI = '{REDIRECT-URI}';
5
$guildID = '{GUILD-ID}';
6
$discordRedirectAuth = '{DISCORD-REDIRECT-AUTH}';
7
$botToken = '{BOT-TOKEN}';
Copied!
  • Click on New Application then name the bot what you would like
  • 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
  • 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
1
$redirect_URI = '{REDIRECT-URI}';
2
$guildID = '{GUILD-ID}';
3
$discordRedirectAuth = '{DISCORD-REDIRECT-AUTH}';
4
$botToken = '{BOT-TOKEN}';
Copied!
  • 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)
  • Now you will need to copy your server's guild ID (check below 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
  • 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

Server API Configuration

1
$serverIP = '{SERVER-IP}';
2
$port = 80; // Website port
3
$steamAPIkey = '{STEAM-API-KEY}';
4
$server_port = 30120;
5
$rconPassword = '{RCON-PASSWORD}';
6
$serverName = '{SERVER-NAME}';
Copied!
  • 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
  • Replace {SERVER-NAME} with your server's name
  • You have now completed the server API configuration section of BadgerStaffPanel

SQL Configuration

1
// SQL INFO
2
$host = '';
3
$username = '';
4
$password = '';
5
$db = '';
6
$port = 3306;
Copied!

Website Permissions Configuration

1
$permissionsSetup = [
2
'{T-MOD-RANK}' => [// Start T-Mod
3
'Permission.Note',
4
'Permission.Warn',
5
'Permission.Kick',
6
'Permission.RemoveNote',
7
'Permission.RemoveWarn',
8
], // End T-Mod
9
'{MOD-RANK}' => [// Start Mod
10
'Permission.Note',
11
'Permission.Warn',
12
'Permission.Kick',
13
'Permission.Tempban',
14
'Permission.Ban',
15
'Permission.RemoveNote',
16
'Permission.RemoveWarn',
17
'Permission.RemoveKick',
18
'Permission.RemoveTempban',
19
], // End Mod
20
'{ADMIN-RANK}' => [ // Start Admin
21
'Permission.Note',
22
'Permission.Warn',
23
'Permission.Kick',
24
'Permission.Tempban',
25
'Permission.Ban',
26
'Permission.RemoveNote',
27
'Permission.RemoveWarn',
28
'Permission.RemoveKick',
29
'Permission.RemoveTempban',
30
'Permission.RemoveBan',
31
], // End Admin
32
'{MANAGEMENT-RANK}' => [ // Start Management
33
'Permission.Note',
34
'Permission.Warn',
35
'Permission.Kick',
36
'Permission.Tempban',
37
'Permission.Ban',
38
'Permission.RemoveNote',
39
'Permission.RemoveWarn',
40
'Permission.RemoveKick',
41
'Permission.RemoveTempban',
42
'Permission.RemoveBan',
43
], // End Management
44
];
Copied!
  • 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
Last modified 1yr ago