diff --git a/README.md b/README.md index 038aab0..6e5c20e 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,6 @@ Hate updating those ACE Permission white-lists? Well just use Discord! Now you can give thanks to this script, and @Illusivee’s. So keep white-lists easy and breezy. This script checks the connecting players Discord roles and checks whether they have the specified role. **Documentation:** -- [Discord Whitelist Setup](https://docs.faxes.zone/docs/discord-whitelist-setup) - [FAXES Documentation Site](https://docs.faxes.zone/docs) - [FAXES ACE Permission Documentation](https://docs.faxes.zone/docs/aceperms) - [Getting Your Steam Hexadecimal](https://docs.faxes.zone/docs/getting-your-steam-hex) diff --git a/server.js b/server.js index f51694c..c92bce7 100644 --- a/server.js +++ b/server.js @@ -4,11 +4,17 @@ /// Config Area /// -var whitelistRoles = [ +var whitelistRoles = [ // Roles by ID that are whitelisted. "333908428995035137" ] + +var blacklistRoles = [ // Roles by Id that are blacklisted. + "333908428995035137" +] + var notWhitelistedMessage = "You're Not Whitelisted. This sever is whitelisted and requires access to join." 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 /// Code /// @@ -30,6 +36,12 @@ on('playerConnecting', (name, setKickReason, deferrals) => { } setTimeout(() => { if(identifierDiscord) { + exports['discordroles']['isRolePresent'](src, blacklistRoles, function(hasRole, roles) { + if(hasRole) { + deferrals.done(blacklistMessage); + if(debugMode) console.log(`^5[DiscordWhitelist]^7 '${name}' with ID '${identifierDiscord.replace('discord:', '')}' is blacklisted to join this server.`) + } + }) exports['discordroles']['isRolePresent'](src, whitelistRoles, function(hasRole, roles) { if(!roles) { deferrals.done(noGuildMessage)