bugfix to perm check

This commit is contained in:
Erik 2021-06-11 04:07:27 +03:00
parent 51717cf7ef
commit 40e41af6ad
No known key found for this signature in database
GPG Key ID: 7E862371D3409F16
2 changed files with 2 additions and 2 deletions

View File

@ -59,7 +59,7 @@ class SettingsCommand extends Command {
const type = !message.guild || args.user ? 'USER' : 'GUILD';
if(type === 'GUILD') {
const permissions = this.client.permissions.execute(message, message.command, ['ADMINISTRATOR', 'MANAGE_GUILD']);
const permissions = await this.client.permissions.execute(message, message.command, ['ADMINISTRATOR', 'MANAGE_GUILD']);
if(permissions.error) return message.respond(message.format('C_SETTINGS_MISSINGPERMISSIONS'), {
emoji: 'failure'
});

View File

@ -30,7 +30,7 @@ class Permissions extends Inhibitor {
return super._succeed();
}
missing = await this._checkGrants(message, command.resolveable);
} else {
} else if(permissionType === 'both') {
const disc = this._checkDiscord(message, permissions);
const grants = await this._checkGrants(message, command.resolveable);
if (disc.length && grants.length) return super._fail({ missing: [...disc, ...grants].join(', ') });