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

Contents of /trunk/src/Shield.js

Parent Directory Parent Directory | Revision Log Revision Log


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

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26