forgot a file

This commit is contained in:
Erik 2023-12-08 00:30:43 +02:00
parent eb0a63a4b9
commit 07eec3cd9d

View File

@ -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;
}
}