3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-20 16:25:03 +00:00

!ban: only run isBanned() if member is not found

This commit is contained in:
Dragory 2021-04-28 21:24:56 +03:00
parent 2386116c3c
commit 0d872e5324

View file

@ -66,8 +66,8 @@ export const BanCmd = modActionsCmd({
const lock = await pluginData.locks.acquire(banLock(user)); const lock = await pluginData.locks.acquire(banLock(user));
let forceban = false; let forceban = false;
const existingTempban = await pluginData.state.tempbans.findExistingTempbanForUserId(user.id); const existingTempban = await pluginData.state.tempbans.findExistingTempbanForUserId(user.id);
const banned = await isBanned(pluginData, user.id);
if (!memberToBan) { if (!memberToBan) {
const banned = await isBanned(pluginData, user.id);
if (banned) { if (banned) {
// Abort if trying to ban user indefinitely if they are already banned indefinitely // Abort if trying to ban user indefinitely if they are already banned indefinitely
if (!existingTempban && !time) { if (!existingTempban && !time) {