From e905d766f86d66d66db8104c2b8bf63c1b10c5ab Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Fri, 29 Dec 2023 17:01:30 +0200 Subject: [PATCH] move handle call --- src/client/infractions/Ban.ts | 3 +-- src/client/infractions/Kick.ts | 3 +-- src/client/infractions/Softban.ts | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/client/infractions/Ban.ts b/src/client/infractions/Ban.ts index fcb0a3e..979d0fa 100644 --- a/src/client/infractions/Ban.ts +++ b/src/client/infractions/Ban.ts @@ -55,8 +55,6 @@ class BanInfraction extends Infraction if (callbacks.size > 0) callbacks.map((c) => this.client.moderation.removeCallback(c.infraction, true)); - await this.handle(); - try { await this.guild.members.ban(this.target!.id, { @@ -68,6 +66,7 @@ class BanInfraction extends Infraction { return this._fail('INFRACTION_ERROR'); } + await this.handle(); return this._succeed(); } diff --git a/src/client/infractions/Kick.ts b/src/client/infractions/Kick.ts index bc77901..5d90dc3 100644 --- a/src/client/infractions/Kick.ts +++ b/src/client/infractions/Kick.ts @@ -50,8 +50,6 @@ class KickInfraction extends Infraction async execute () { - await this.handle(); - try { await this.member!.kick(this._reason); @@ -60,6 +58,7 @@ class KickInfraction extends Infraction { return this._fail('INFRACTION_ERROR'); } + await this.handle(); return this._succeed(); } diff --git a/src/client/infractions/Softban.ts b/src/client/infractions/Softban.ts index 12c5746..d8c55d3 100644 --- a/src/client/infractions/Softban.ts +++ b/src/client/infractions/Softban.ts @@ -47,7 +47,6 @@ class SoftbanInfraction extends Infraction let days = 1; if (this.arguments.days) days = this.arguments.days.asNumber; - await this.handle(); try { @@ -61,6 +60,7 @@ class SoftbanInfraction extends Infraction { return this._fail('INFRACTION_ERROR'); } + await this.handle(); return this._succeed(); }