From 31a1fbe865811710e1d02f87598bc53f6f66c087 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Tue, 26 Mar 2024 16:22:10 +0200 Subject: [PATCH 1/3] Await handleTimedInfraction --- src/client/components/managers/ModerationManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/components/managers/ModerationManager.ts b/src/client/components/managers/ModerationManager.ts index bb1f12a..44bfe8a 100644 --- a/src/client/components/managers/ModerationManager.ts +++ b/src/client/components/managers/ModerationManager.ts @@ -204,7 +204,7 @@ class ModerationManager implements Initialisable, CallbackClient const results = await this.#client.mongodb.infractions.find(filter); this.#logger.info(`Filtering ${results.length} infractions for callback.`); for (const result of results) - this.handleTimedInfraction(result); + await this.handleTimedInfraction(result); const ids = results.map(result => result._id); await this.#client.mongodb.infractions.removeProperty({ _id: { $in: ids } }, [ '_callbacked' ]); this.#ready = true; -- 2.45.2 From 72bccab28249aca8e791ca09dd399c75012abd91 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Tue, 26 Mar 2024 16:30:47 +0200 Subject: [PATCH 2/3] bugfixes --- src/client/components/managers/ModerationManager.ts | 4 +++- src/client/components/observers/UtilityHook.ts | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/client/components/managers/ModerationManager.ts b/src/client/components/managers/ModerationManager.ts index 44bfe8a..533a936 100644 --- a/src/client/components/managers/ModerationManager.ts +++ b/src/client/components/managers/ModerationManager.ts @@ -754,7 +754,9 @@ class ModerationManager implements Initialisable, CallbackClient async findActiveInfraction (type: InfractionType, target: string, guild: string) { const [ callback ] = await this.#client.callbacks.queryCallbacks({ type, target, guild }, this); - return callback ?? null; + if (!callback) + return null; + return callback; } async findActiveInfractions (query: Partial) diff --git a/src/client/components/observers/UtilityHook.ts b/src/client/components/observers/UtilityHook.ts index cff1bec..01022e9 100644 --- a/src/client/components/observers/UtilityHook.ts +++ b/src/client/components/observers/UtilityHook.ts @@ -71,7 +71,7 @@ class UtilityHook extends Observer // }); const callback = await this.client.moderation.findActiveInfraction('MUTE', member.id, guild.id); - const infraction = callback.payload; + const infraction = callback?.payload; if (!infraction || infraction.resolved) return; -- 2.45.2 From e05fe60e5c5335749fca562e27bf1dc6e5066d29 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Tue, 26 Mar 2024 17:31:33 +0200 Subject: [PATCH 3/3] bugfix --- src/middleware/Controller.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/middleware/Controller.ts b/src/middleware/Controller.ts index 20faef0..9828da4 100644 --- a/src/middleware/Controller.ts +++ b/src/middleware/Controller.ts @@ -86,6 +86,7 @@ class Controller extends EventEmitter // this.#shardingManager.on('message', this._handleMessage.bind(this)); process.on('SIGINT', this.shutdown.bind(this)); + process.on('SIGTERM', this.shutdown.bind(this)); } async build () -- 2.45.2