Fix GuildMember.hasPermission(s) explicit for owner

This commit is contained in:
Schuyler Cebulskie
2016-09-12 00:08:12 -04:00
parent 38c85dc076
commit 774b4d4694

View File

@@ -185,7 +185,7 @@ class GuildMember {
* @returns {boolean} * @returns {boolean}
*/ */
hasPermission(permission, explicit = false) { hasPermission(permission, explicit = false) {
if (this.guild.owner.id === this.user.id) return true; if (!explicit && this.guild.owner.id === this.user.id) return true;
return this.roles.some(r => r.hasPermission(permission, explicit)); return this.roles.some(r => r.hasPermission(permission, explicit));
} }
@@ -196,7 +196,7 @@ class GuildMember {
* @returns {boolean} * @returns {boolean}
*/ */
hasPermissions(permissions, explicit = false) { hasPermissions(permissions, explicit = false) {
if (this.guild.owner.id === this.user.id) return true; if (!explicit && this.guild.owner.id === this.user.id) return true;
return permissions.map(p => this.hasPermission(p, explicit)).every(v => v); return permissions.map(p => this.hasPermission(p, explicit)).every(v => v);
} }