mirror of
https://github.com/danbulant/discord.js
synced 2026-07-08 12:40:50 +00:00
Fix GuildMember.hasPermission(s) explicit for owner
This commit is contained in:
parent
38c85dc076
commit
774b4d4694
1 changed files with 2 additions and 2 deletions
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue