bugfix
This commit is contained in:
parent
a938539993
commit
2bec9eee0f
@ -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');
|
||||
|
Loading…
Reference in New Issue
Block a user