diff --git a/src/structure/infractions/Ban.js b/src/structure/infractions/Ban.js index b658092..f596a47 100644 --- a/src/structure/infractions/Ban.js +++ b/src/structure/infractions/Ban.js @@ -48,7 +48,7 @@ class BanInfraction extends Infraction { 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)); + if (callbacks.size > 0) callbacks.map((c) => this.client.moderationManager.removeCallback(c.infraction, true)); return this._succeed(); @@ -56,13 +56,14 @@ class BanInfraction extends Infraction { async verify() { - if (this.target instanceof GuildMember) { - if (!this.member.bannable) return super._fail('C_BAN_CANNOTBEBANNED'); - } + const member = await this.guild.resolveMember(this.target.id); + if (member && !member.bannable) + return super._fail('C_BAN_CANNOTBEBANNED'); + let alreadyBanned = null; try { - alreadyBanned = await this.guild.bans.fetch(this.member.id); + alreadyBanned = await this.guild.bans.fetch(this.target.id); } catch (e) { } //eslint-disable-line no-empty if (alreadyBanned) return super._fail('C_BAN_ALREADYBANNED');