move permission handler into functions
This commit is contained in:
parent
c69d2f562d
commit
5ffce3ff95
1 changed files with 17 additions and 2 deletions
|
@ -74,11 +74,26 @@ class Functions {
|
|||
return role;
|
||||
}
|
||||
|
||||
intBetween (min, max) {
|
||||
return Math.round((Math.random() * (max - min) + min));
|
||||
checkPermissions (command, message, member) {
|
||||
const missingPerms = [];
|
||||
|
||||
if (member.user.bot) {
|
||||
command.conf.botPerms.forEach(p => {
|
||||
if (!message.channel.permissionsFor(member).has(p)) missingPerms.push(p);
|
||||
});
|
||||
} else {
|
||||
command.conf.userPerms.forEach(p => {
|
||||
if (!message.channel.permissionsFor(member).has(p)) missingPerms.push(p);
|
||||
});
|
||||
}
|
||||
|
||||
if (missingPerms.length > 0) return missingPerms;
|
||||
}
|
||||
|
||||
|
||||
intBetween (min, max) {
|
||||
return Math.round((Math.random() * (max - min) + min));
|
||||
}
|
||||
|
||||
isDeveloper (id) {
|
||||
if (this.client.config.ownerIDs.includes(id)) {
|
||||
|
|
Loading…
Reference in a new issue