From 72bccab28249aca8e791ca09dd399c75012abd91 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Tue, 26 Mar 2024 16:30:47 +0200 Subject: [PATCH] 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;