/[sudobot]/trunk/src/Shield.js
ViewVC logotype

Diff of /trunk/src/Shield.js

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 11 by rakin, Mon Jul 29 17:28:13 2024 UTC revision 16 by rakin, Mon Jul 29 17:28:14 2024 UTC
# Line 1  Line 1 
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  };  };

Legend:
Removed from v.11  
changed lines
  Added in v.16

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26