1 |
module.exports = class Shield { |
module.exports = class Shield { |
2 |
verify(msg, cm) { |
verify(msg, cm) { |
3 |
return app.config.props[msg.guild.id].global_commands.indexOf(cm.commandName) !== -1 || msg.member.roles.cache.has(app.config.props[msg.guild.id].mod_role); |
if (app.config.props[msg.guild.id].global_commands.indexOf(cm.commandName) !== -1) { |
4 |
|
return true; |
5 |
|
} |
6 |
|
|
7 |
|
if (!msg.member.roles.cache.has(app.config.props[msg.guild.id].mod_role)) { |
8 |
|
return false; |
9 |
|
} |
10 |
|
|
11 |
|
const roles = app.config.props[msg.guild.id].role_commands; |
12 |
|
|
13 |
|
for (let roleID in roles) { |
14 |
|
if (msg.member.roles.cache.has(roleID) && roles[roleID].indexOf(cm.commandName) === -1) { |
15 |
|
return true; |
16 |
|
} |
17 |
|
} |
18 |
|
|
19 |
|
return false; |
20 |
} |
} |
21 |
}; |
}; |