fix: Role#setPermissions resolving & docs

This commit is contained in:
Lewdcario
2018-04-18 19:57:16 -05:00
parent 92b421607e
commit 7c0b6173dd
3 changed files with 3 additions and 3 deletions

View File

@@ -165,7 +165,7 @@ class Permissions {
static resolve(permission) {
if (permission instanceof Array) return permission.map(p => this.resolve(p)).reduce((prev, p) => prev | p, 0);
if (typeof permission === 'string') permission = this.FLAGS[permission];
if (typeof permission !== 'number' || permission < 1) throw new RangeError(Constants.Errors.NOT_A_PERMISSION);
if (typeof permission !== 'number' || permission < 0) throw new RangeError(Constants.Errors.NOT_A_PERMISSION);
return permission;
}
}