From c7c1b1f96f2b6241f54476d8e148069c1c3d6770 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Wed, 28 Apr 2021 21:24:56 +0300 Subject: [PATCH] !ban: only run isBanned() if member is not found --- backend/src/plugins/ModActions/commands/BanCmd.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/src/plugins/ModActions/commands/BanCmd.ts b/backend/src/plugins/ModActions/commands/BanCmd.ts index da7156c2..f42b426a 100644 --- a/backend/src/plugins/ModActions/commands/BanCmd.ts +++ b/backend/src/plugins/ModActions/commands/BanCmd.ts @@ -66,8 +66,8 @@ export const BanCmd = modActionsCmd({ const lock = await pluginData.locks.acquire(banLock(user)); let forceban = false; const existingTempban = await pluginData.state.tempbans.findExistingTempbanForUserId(user.id); - const banned = await isBanned(pluginData, user.id); if (!memberToBan) { + const banned = await isBanned(pluginData, user.id); if (banned) { // Abort if trying to ban user indefinitely if they are already banned indefinitely if (!existingTempban && !time) {