Await handleTimedInfraction

This commit is contained in:
Erik 2024-03-26 16:22:10 +02:00
parent c1c4786579
commit 31a1fbe865

View File

@ -204,7 +204,7 @@ class ModerationManager implements Initialisable, CallbackClient
const results = await this.#client.mongodb.infractions.find<InfractionJSON>(filter); const results = await this.#client.mongodb.infractions.find<InfractionJSON>(filter);
this.#logger.info(`Filtering ${results.length} infractions for callback.`); this.#logger.info(`Filtering ${results.length} infractions for callback.`);
for (const result of results) for (const result of results)
this.handleTimedInfraction(result); await this.handleTimedInfraction(result);
const ids = results.map(result => result._id); const ids = results.map(result => result._id);
await this.#client.mongodb.infractions.removeProperty({ _id: { $in: ids } }, [ '_callbacked' ]); await this.#client.mongodb.infractions.removeProperty({ _id: { $in: ids } }, [ '_callbacked' ]);
this.#ready = true; this.#ready = true;