forked from engineering/cloudservices
please
parent
2a473b65b7
commit
8bcd610462
|
@ -21,18 +21,12 @@ export default class {
|
||||||
let hasUserPerms: boolean;
|
let hasUserPerms: boolean;
|
||||||
if (resolved.permissions.users) {
|
if (resolved.permissions.users) {
|
||||||
hasUserPerms = resolved.permissions.users.includes(message.author.id);
|
hasUserPerms = resolved.permissions.users.includes(message.author.id);
|
||||||
} else {
|
|
||||||
hasUserPerms = true;
|
|
||||||
}
|
}
|
||||||
let hasRolePerms: boolean = false;
|
let hasRolePerms: boolean = false;
|
||||||
if (resolved.permissions.roles) {
|
for (const role of resolved.permissions.roles) {
|
||||||
for (const role of resolved.permissions.roles) {
|
if (message.member && message.member.roles.includes(role)) {
|
||||||
if (message.member && message.member.roles.includes(role)) {
|
hasRolePerms = true; break;
|
||||||
hasRolePerms = true; break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
hasRolePerms = true;
|
|
||||||
}
|
}
|
||||||
if (!hasRolePerms && !hasUserPerms) return;
|
if (!hasRolePerms && !hasUserPerms) return;
|
||||||
if (!resolved.enabled) { message.channel.createMessage(`***${this.client.stores.emojis.error} This command has been disabled***`); return; }
|
if (!resolved.enabled) { message.channel.createMessage(`***${this.client.stores.emojis.error} This command has been disabled***`); return; }
|
||||||
|
|
Loading…
Reference in New Issue