diff --git a/src/client/infractions/Ban.ts b/src/client/infractions/Ban.ts index 87845cd..78a9866 100644 --- a/src/client/infractions/Ban.ts +++ b/src/client/infractions/Ban.ts @@ -73,7 +73,7 @@ class BanInfraction extends Infraction async verify () { - const member = await this.guild.resolveMember(this.target!.id); + const member = await this.guild.resolveMember(this.target!.id).catch(() => null); if (member && !member.bannable) return super._fail('C_BAN_CANNOTBEBANNED'); diff --git a/src/client/infractions/Softban.ts b/src/client/infractions/Softban.ts index 318758e..6e4da42 100644 --- a/src/client/infractions/Softban.ts +++ b/src/client/infractions/Softban.ts @@ -53,7 +53,7 @@ class SoftbanInfraction extends Infraction { await this.guild.members.ban(this.target!.id, { reason: this._reason, - deleteMessageDays: days + deleteMessageSeconds: days * 24 * 60 * 60 }); await this.guild.members.unban(this.target!.id, this._reason); } diff --git a/src/client/interfaces/CommandOption.ts b/src/client/interfaces/CommandOption.ts index 52f75c5..a8e1551 100644 --- a/src/client/interfaces/CommandOption.ts +++ b/src/client/interfaces/CommandOption.ts @@ -353,7 +353,7 @@ class CommandOption throw new Error('Invalid rawValue'); for (const arg of this.#rawValue) { - const member = await this.#guild.resolveMember(arg, this.strict); + const member = await this.#guild.resolveMember(arg, this.strict).catch(() => null); if (member) { members.push(member); @@ -618,7 +618,7 @@ class CommandOption throw new Error('Missing guild'); if (typeof this.#rawValue !== 'string') throw new Error('Invalid rawValue'); - const member = await this.#guild.resolveMember(this.#rawValue, this.strict); + const member = await this.#guild.resolveMember(this.#rawValue, this.strict).catch(() => null); if (!member) return { error: true }; return { value: member, removed: [ this.#rawValue ] }; diff --git a/src/client/interfaces/Infraction.ts b/src/client/interfaces/Infraction.ts index cd5db55..a65320e 100644 --- a/src/client/interfaces/Infraction.ts +++ b/src/client/interfaces/Infraction.ts @@ -874,7 +874,7 @@ class Infraction else if (type) { if (Util.isMemberResolveable(target)) - fetched = await this.#guild.memberWrapper(target); // await this.#client.resolver.resolveMember(target, this.#guild, true); + fetched = await this.#guild.memberWrapper(target).catch(() => null); // await this.#client.resolver.resolveMember(target, this.#guild, true); if (!fetched && Util.isUserResolveable(target)) fetched = await this.#client.getUserWrapper(target); // await this.#client.resolver.resolveUser(target, true);