From fab2cbace9f5c7f9b24c6efaf26359ed32b90596 Mon Sep 17 00:00:00 2001 From: Taken Date: Tue, 5 Dec 2023 21:29:34 +0100 Subject: [PATCH] Updated ban command --- src/commands/ban.js | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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