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:
Souji
2020-02-07 18:27:05 +01:00
committed by GitHub
parent b4e56d3e0e
commit 3f039016af

View File

@@ -216,6 +216,7 @@ class GuildMember extends Base {
get manageable() {
if (this.user.id === this.guild.ownerID) 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');
return this.guild.me.roles.highest.comparePositionTo(this.roles.highest) > 0;
}