This commit is contained in:
Erik 2024-03-26 16:30:47 +02:00
parent 31a1fbe865
commit 72bccab282
2 changed files with 4 additions and 2 deletions

View File

@ -754,7 +754,9 @@ class ModerationManager implements Initialisable, CallbackClient
async findActiveInfraction (type: InfractionType, target: string, guild: string) async findActiveInfraction (type: InfractionType, target: string, guild: string)
{ {
const [ callback ] = await this.#client.callbacks.queryCallbacks<InfractionJSON>({ type, target, guild }, this); const [ callback ] = await this.#client.callbacks.queryCallbacks<InfractionJSON>({ type, target, guild }, this);
return callback ?? null; if (!callback)
return null;
return callback;
} }
async findActiveInfractions (query: Partial<InfractionJSON>) async findActiveInfractions (query: Partial<InfractionJSON>)

View File

@ -71,7 +71,7 @@ class UtilityHook extends Observer
// }); // });
const callback = await this.client.moderation.findActiveInfraction('MUTE', member.id, guild.id); const callback = await this.client.moderation.findActiveInfraction('MUTE', member.id, guild.id);
const infraction = callback.payload; const infraction = callback?.payload;
if (!infraction || infraction.resolved) if (!infraction || infraction.resolved)
return; return;