diff --git a/src/commands/ban.js b/src/commands/ban.js index dd0e0a0..5bf1232 100644 --- a/src/commands/ban.js +++ b/src/commands/ban.js @@ -57,6 +57,15 @@ module.exports = { return } + if (interaction.guild.members.me.roles.highest.position <= member.roles.highest.position) { + await interaction.editReply("I cannot ban this member.") + return + } + + if (member.id === mod.id) { + return interaction.editReply("You cannot ban yourself.") + } + if (member.id === interaction.applicationId) { await interaction.editReply("I cannot ban myself.") return @@ -67,10 +76,6 @@ module.exports = { return } - if (member.id === mod.id) { - return interaction.editReply("You cannot ban yourself.") - } - if (memberRoles.includes(helper) || memberRoles.includes(admin)) { await interaction.editReply("I cannot ban a moderator.") return