diff --git a/src/commands/blacklist.js b/src/commands/blacklist.js index 8930dfd..a818eca 100644 --- a/src/commands/blacklist.js +++ b/src/commands/blacklist.js @@ -39,6 +39,17 @@ exports.run = async (client, message, [action, ...member]) => { if(user.id === client.user.id) { return message.channel.send('lol no'); }; + + if (user.id === message.guild.owner.id) { + return message.channel.send("<:error:466995152976871434> You can't blacklist the owner!") + }; + + let admin = message.guild.member(message.author) + if (user.highestRole.position >= admin.highestRole.position && admin.user.id !== message.guild.ownerID) { + return message.channel.send( + `<:error:466995152976871434> You can't blacklist people higher ranked than yourself!` + ); + }; if(user.id === message.member.id) { return message.channel.send('<:error:466995152976871434> You can\'t blacklist yourself!'); diff --git a/src/commands/settings.js b/src/commands/settings.js index 7e8eab2..6cc58bc 100644 --- a/src/commands/settings.js +++ b/src/commands/settings.js @@ -65,14 +65,14 @@ exports.run = async (client, message, args) => { leaveMessage = "`" + settings.leaveMessage + "`"; } - if(settings.blacklisted == "ARRAY") { + if(settings.blacklisted == "ARRAY" || settings.blacklisted.length < 1) { blacklist = "__Disabled__"; } else { if(settings.blacklisted.length > 0) { settings.blacklisted.forEach(function(user) { - blacklist += "`" + (client.users.get(user) || user) + "` ," + blacklist += "`" + (client.users.get(user).tag || user.tag) + "`, " }); - blacklist = blacklist.substr(0, blacklist.length, -3) + blacklist = blacklist.substring(0, blacklist.length - 2); }; };