Parent Directory
|
Revision Log
Added support of disabling commands for different roles
1 | rakin | 11 | module.exports = class Shield { |
2 | verify(msg, cm) { | ||
3 | rakin | 16 | 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 | rakin | 11 | } |
21 | }; |
[email protected] | ViewVC Help |
Powered by ViewVC 1.1.26 |