mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 09:33:32 +01:00
Fix GuildMember.hasPermission(s) explicit for owner
This commit is contained in:
@@ -185,7 +185,7 @@ class GuildMember {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
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));
|
||||
}
|
||||
|
||||
@@ -196,7 +196,7 @@ class GuildMember {
|
||||
* @returns {boolean}
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user