move handle call

This commit is contained in:
Erik 2023-12-29 17:01:30 +02:00
parent 0a2a37f23e
commit e905d766f8
3 changed files with 3 additions and 5 deletions

View File

@ -55,8 +55,6 @@ class BanInfraction extends Infraction
if (callbacks.size > 0) if (callbacks.size > 0)
callbacks.map((c) => this.client.moderation.removeCallback(c.infraction, true)); callbacks.map((c) => this.client.moderation.removeCallback(c.infraction, true));
await this.handle();
try try
{ {
await this.guild.members.ban(this.target!.id, { await this.guild.members.ban(this.target!.id, {
@ -68,6 +66,7 @@ class BanInfraction extends Infraction
{ {
return this._fail('INFRACTION_ERROR'); return this._fail('INFRACTION_ERROR');
} }
await this.handle();
return this._succeed(); return this._succeed();
} }

View File

@ -50,8 +50,6 @@ class KickInfraction extends Infraction
async execute () async execute ()
{ {
await this.handle();
try try
{ {
await this.member!.kick(this._reason); await this.member!.kick(this._reason);
@ -60,6 +58,7 @@ class KickInfraction extends Infraction
{ {
return this._fail('INFRACTION_ERROR'); return this._fail('INFRACTION_ERROR');
} }
await this.handle();
return this._succeed(); return this._succeed();
} }

View File

@ -47,7 +47,6 @@ class SoftbanInfraction extends Infraction
let days = 1; let days = 1;
if (this.arguments.days) if (this.arguments.days)
days = this.arguments.days.asNumber; days = this.arguments.days.asNumber;
await this.handle();
try try
{ {
@ -61,6 +60,7 @@ class SoftbanInfraction extends Infraction
{ {
return this._fail('INFRACTION_ERROR'); return this._fail('INFRACTION_ERROR');
} }
await this.handle();
return this._succeed(); return this._succeed();
} }