[FREE] Discord Whitelist

Discord Whitelist
A very simple discord whitelist script I made because I was bored and wanted to learn a little how the discord apis work.

When a player are not whitelisted its coming up a adaptive card where you can customize and set your own logotype and on the button you can navigate to your discord server.

Config

Config.Settings = {
    discord = {
        discordGuildId = , -- https://gyazo.com/5aa52f81977372e26f75c9ce07db7c83.
        botToken = '', -- You have to create a bot here (https://discord.com/developers/applications) then add it into your server and copy the bot token and paste it where its blank.
    },

    whitelistRole = , -- What role that have access to your the server (https://gyazo.com/fc9677afd09e62fceea3a4115e108c7a)

    lang = {
        notWhitelisted = 'You are not whitelisted on (Server Name)',
        checkConnection = 'Check that you have connected your discord with FiveM',
        joinDiscord = 'Join our discord here'
    },

    card = {
        image = 'https://cdn.discordapp.com/attachments/1022227022967218206/1082954076783923230/TransparentVertex.png',
        discordUrl = 'https://discord.com/invite/yourdiscord'
    }
}

Download here

Code is accessible Yes
Subscription-based No
Lines (approximately) 75
Requirements Nothing
Support No
7 Likes

you have a unused call to esx

I did, forgot to remove it.

Update

  • Added a adaptive card when you are not whitelisted.
  • You can now add your logotype.
  • Navigate to your own discord on the button.

Hey good job !, but you should do a cache system, bc the api discord have a limit and u could be shadow ban (i think?) if u do too many requests

Ooh thats probably true, I might fix that tomorrow didn’t really think about that.

No, i have much in school right now so i dont really have the time to fix it

hi, when u enter appear this https://forum.cfx.re/uploads/default/original/4X/5/5/6/55682198f6bbdc568a5f5266d7fd57845f7aea09.png but like in 2 second after appear this Imgur: The magic of the Internet

Hey, you need to invite the bot to the discord server that you used in the cfg.

@dillenscripts Great release though <3

it’s already in my discord

I would love to see the capabilities to add different roles with permissions through this code as well such as admin, server managers and moderators

It does not work, I put everything and the bot does not turn on.

you can use guardian with badger discord api for whitelists.

you can also use ace discord perms and it will kick anyone with out a discord group on the server so kinda like a whitelist but the kick message doesnt make sense so its easier to just use guardian.

the discord bots dont need to turn online they just need access to query the membership lists.