From 79f7c0067094b5b9746a342309c89596810ff8ed Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Sun, 28 Jul 2024 18:51:07 +0300 Subject: [PATCH] Fix order of operations --- src/client/interfaces/Infraction.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/client/interfaces/Infraction.ts b/src/client/interfaces/Infraction.ts index ad39b90..295d858 100644 --- a/src/client/interfaces/Infraction.ts +++ b/src/client/interfaces/Infraction.ts @@ -264,13 +264,13 @@ class Infraction } } - if (this.#duration) - await this.#client.moderation.handleTimedInfraction(this.json); - - /* LMAOOOO PLEASE DONT JUDGE ME */ + // Remove the role structures as they will cause problems when serialising for database if (this.#data.roles) delete this.#data.roles; + if (this.#duration) + await this.#client.moderation.handleTimedInfraction(this.json); + return this.save(); }