diff --git a/src/structure/infractions/Ban.js b/src/structure/infractions/Ban.js index f596a47..161bc18 100644 --- a/src/structure/infractions/Ban.js +++ b/src/structure/infractions/Ban.js @@ -34,6 +34,12 @@ class BanInfraction extends Infraction { let days = 0; if (this.message && this.message._caller === 'hardban') days = 1; if (this.arguments.days) days = this.arguments.days.value; + + const callbacks = this.client.moderationManager.callbacks.filter((c) => c.infraction.type === 'BAN' + && c.infraction.target === this.target.id); + + if (callbacks.size > 0) callbacks.map((c) => this.client.moderationManager.removeCallback(c.infraction, true)); + await this.handle(); try { @@ -45,11 +51,6 @@ class BanInfraction extends Infraction { return this._fail('INFRACTION_ERROR'); } - const callbacks = this.client.moderationManager.callbacks.filter((c) => c.infraction.type === 'BAN' - && c.infraction.target === this.target.id); - - if (callbacks.size > 0) callbacks.map((c) => this.client.moderationManager.removeCallback(c.infraction, true)); - return this._succeed(); }