From 07eec3cd9db89be05c908323a5b8a444bd1a7b98 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Fri, 8 Dec 2023 00:30:43 +0200 Subject: [PATCH] forgot a file --- src/client/components/ModerationManager.ts | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/client/components/ModerationManager.ts b/src/client/components/ModerationManager.ts index ac625c3..b820a58 100644 --- a/src/client/components/ModerationManager.ts +++ b/src/client/components/ModerationManager.ts @@ -366,12 +366,12 @@ class ModerationManager implements Initialisable break; } } - if (modpoints.multiplier) + if (modpoints.multiplier) expiration *= points; } const verify = async (infraction: InfractionClass, escalated = false): - Promise<(InfractionFail | InfractionSuccess) & { escalation?: EscalationResult }> => + Promise<(InfractionFail | InfractionSuccess) & { escalation?: EscalationResult }> => { // const verification = await infraction.verify(info.executor, target, info.channel); @@ -456,9 +456,9 @@ class ModerationManager implements Initialisable let response = await verify(infraction); - if (response.escalation) + if (response.escalation) { - if (Constant.Hierarchy[infraction.type] <= Constant.Hierarchy[response.escalation.type]) + if (Constant.Hierarchy[infraction.type] <= Constant.Hierarchy[response.escalation.type]) { // this is just to shut up the TS checker const escalationClass = Constant.Infractions[response.escalation.type] as typeof InfractionClass; @@ -499,7 +499,6 @@ class ModerationManager implements Initialisable points, expiration, timestamp: response.infraction.timestamp, id: response.infraction.id }); return result; - } async _handleArguments (invoker: InvokerWrapper, targets: ModerationTargets, args: {[key: string]: CommandOption | undefined}) @@ -569,13 +568,13 @@ class ModerationManager implements Initialisable executor }).execute(); } - catch (err) + catch (err) { const error = err as Error; this.#logger.error(`Error when resolving infraction:\n${error.stack || error}`); } } - else + else { // Target left guild or channel was removed from the guild. What should happen in this situation? // Maybe continue checking if the user rejoins, but the channel will always be gone. @@ -614,9 +613,7 @@ class ModerationManager implements Initialisable }, callBackAt - currentDate), infraction }); - } - } async removeCallback (infraction: InfractionClass | InfractionJSON, updateCase = false) @@ -668,8 +665,7 @@ class ModerationManager implements Initialisable async findLatestInfraction (type: InfractionType, target: ModerationTarget) { - - const callback = this.#callbacks.filter((c) => + const callback = this.#callbacks.filter((c) => { return c.infraction.type === type && c.infraction.target === target.id; @@ -683,7 +679,6 @@ class ModerationManager implements Initialisable { sort: { timestamp: -1 } } ); return result || null; - } }