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

Annotation of /trunk/src/Shield.js

Parent Directory Parent Directory | Revision Log Revision Log


Revision 19 - (hide annotations)
Mon Jul 29 17:28:14 2024 UTC (8 months, 1 week ago) by rakin
File MIME type: text/javascript
File size: 822 byte(s)
Fixup
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 rakin 19 //console.log('mod-role not found: ' + msg.author.tag);
9     return false;
10 rakin 16 }
11    
12     const roles = app.config.props[msg.guild.id].role_commands;
13    
14     for (let roleID in roles) {
15 rakin 19 // console.log(roleID + ' search');
16     if (msg.member.roles.cache.has(roleID)) {
17     if (roles[roleID].indexOf(cm.commandName) === -1) {
18 rakin 16 return true;
19 rakin 19 }
20     else {
21     return false;
22     }
23 rakin 16 }
24     }
25    
26     return false;
27 rakin 11 }
28     };

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26