Weblutions Documentation
Weblutions Main Site Contact Us Our Discord
Some pages are still pending proper formatting, if required refer to the legacy documentation website.
FiveM Documentation IconFiveM Documentation

Weblutions Documentation / FiveM Documentation / Discord Whitelist

Updated

Discord Whitelist

By Josh M. 1 mins 3

Hate updating those ACE Permission or database white-lists? Well just use Discord! DiscordWhitelist allows you to use a dynamic whitelist system based off of Discord roles.

This guide will assist you in setting up Discord Whitelist for your community. Follow it through and if you need assistance contact us.


Creating Discord Bot

To operate DiscordWhitelist a Discord bot application has to be created and be a member of the guild/server. To create a Discord bot:

  1. Create an application on the Discord Developer Portal.

  2. Click on 'Bot' on the left navigation bar and enable the bot. Fetch the bot token from this page and keep it handy for later as it only displays once.

  3. Now in the 'General Information' tab copy the 'Client ID' and replace CLIENT_ID_HERE in the below template then navigate to that link.

https://discord.com/oauth2/authorize?client_id=CLIENT_ID_HERE&scope=bot&permissions=8

This will allow you to invite the Discord bot to your guild/server.

Installing The Resource

To install the FiveM/RedM resource the below steps must be followed correctly for the resource to fully function.

  1. Download and unzip Discord Whitelist. If you're missing the files it can be downloaded through our Website.

  2. Open the config.js file in the resource and edit to the your liking and save it. Ensure to add the bot token copied while creating the bot.

  3. Add ensure DiscordWhitelist into your server.cfg to ensure the resource loads.

The Discord Bot will never show an online status within the Discord client as it doesn't use the Discord API to be an online bot, just fetch member data.

Example Configuration File

var enableWhitelist = true;
var guildId = "358072894867111966"; 
var botToken = "TDWzMDE0ODIwMzQ5NjczNTZz.YDJJDg.TET4ro8l1IT0GA73PLgUGs4vU01";
var licenseKey = "CoWOtuE_zUmu1jW1FK9bJC0GECjA8uS4RncEUplolRUSJ";

var whitelistRoles = [
    "906061699562475581",
    "561341615759949834"
];

var blacklistRoles = [
    "ROLE_ID"
];

var notWhitelistedMessage = "You're Not Whitelisted. Please wait <> before trying again.";
var noGuildMessage = "Guild Not Detected. It seems you're not in the guild for this community.";
var blacklistMessage = "You're blacklisted from this server.";
var debugMode = false;
var cacheMaxTime = "2m";

Learn more about the Cache time - Discord Whitelist Cache.