From ac78ac158bb75df36edb8bbe2dca67f441bdae5e Mon Sep 17 00:00:00 2001 From: filipnyquist Date: Mon, 30 Jul 2018 15:09:45 +0200 Subject: [PATCH] Added lowercase to wunderbot ranks. Fixes #160. --- bot/modules/rolesetter.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bot/modules/rolesetter.js b/bot/modules/rolesetter.js index 7258e7a..20c7ca4 100644 --- a/bot/modules/rolesetter.js +++ b/bot/modules/rolesetter.js @@ -12,11 +12,13 @@ exports.addrole = { usage: '', description: 'Adds you to specified role', process: function(bot, msg, suffix) { + rolelist.allowedroles = rolelist.allowedroles.map(v => v.toLowerCase()); // Here the bot,msg and suffix is avaible, this function can be async if needed. let newrole = msg.guild.roles.find('name', suffix); let baserole = msg.guild.roles.find('name', rolelist.baserole); // Checks if the user put a role in the message. if (suffix) { + suffix = suffix.toLowerCase(); // Checks if the role mentioned in the message is in the allowed roles listed in the wunderbot config. if (rolelist.allowedroles.includes(suffix)) { // Checks if the role even exists in the discord server