Skip to content

Commit

Permalink
fix(guildmember): check if member has administrator permission (#7384)
Browse files Browse the repository at this point in the history
  • Loading branch information
fowlerro committed Feb 12, 2022
1 parent fa97a31 commit 81d8b54
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/discord.js/src/structures/GuildMember.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,11 @@ class GuildMember extends Base {
* @readonly
*/
get moderatable() {
return this.manageable && (this.guild.me?.permissions.has(PermissionFlagsBits.ModerateMembers) ?? false);
return (
!this.permissions.has(PermissionFlagsBits.Administrator) &&
this.manageable &&
(this.guild.me?.permissions.has(PermissionFlagsBits.ModerateMembers) ?? false)
);
}

/**
Expand Down

0 comments on commit 81d8b54

Please sign in to comment.