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'
}
}
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.