Custom hasPermission

This commit is contained in:
Daniel Odendahl Jr
2017-05-28 02:30:06 +00:00
parent 1cd3ca22bc
commit 208652d270
17 changed files with 47 additions and 17 deletions
+4 -1
View File
@@ -30,7 +30,10 @@ module.exports = class WarnCommand extends Command {
}
hasPermission(msg) {
return msg.member.hasPermission('KICK_MEMBERS') || msg.member.roles.has(msg.guild.settings.get('staffRole'));
const staffRole = msg.guild.roles.get(msg.guild.settings.get('staffRole'));
if (staffRole && !msg.member.roles.has(staffRole)) return `You do not have the ${staffRole.name} role.`;
else if (!msg.member.hasPermission('KICK_MEMBERS')) return 'You do not have the `Kick Members` Permission.';
else return true;
}
async run(msg, args) {