mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-19 13:03:31 +01:00
fix(GuildMember): manageable - let owner override (#3765)
* if the bot is owner of the guild the target is managebale * even though both roles are on the same position
This commit is contained in:
@@ -216,6 +216,7 @@ class GuildMember extends Base {
|
|||||||
get manageable() {
|
get manageable() {
|
||||||
if (this.user.id === this.guild.ownerID) return false;
|
if (this.user.id === this.guild.ownerID) return false;
|
||||||
if (this.user.id === this.client.user.id) return false;
|
if (this.user.id === this.client.user.id) return false;
|
||||||
|
if (this.client.user.id === this.guild.ownerID) return true;
|
||||||
if (!this.guild.me) throw new Error('GUILD_UNCACHED_ME');
|
if (!this.guild.me) throw new Error('GUILD_UNCACHED_ME');
|
||||||
return this.guild.me.roles.highest.comparePositionTo(this.roles.highest) > 0;
|
return this.guild.me.roles.highest.comparePositionTo(this.roles.highest) > 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user