forked from Galactic/galactic-bot
fix tempbans
This commit is contained in:
parent
df53af7a4c
commit
c072bf18db
@ -34,6 +34,12 @@ class BanInfraction extends Infraction {
|
|||||||
let days = 0;
|
let days = 0;
|
||||||
if (this.message && this.message._caller === 'hardban') days = 1;
|
if (this.message && this.message._caller === 'hardban') days = 1;
|
||||||
if (this.arguments.days) days = this.arguments.days.value;
|
if (this.arguments.days) days = this.arguments.days.value;
|
||||||
|
|
||||||
|
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, true));
|
||||||
|
|
||||||
await this.handle();
|
await this.handle();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
@ -45,11 +51,6 @@ class BanInfraction extends Infraction {
|
|||||||
return this._fail('INFRACTION_ERROR');
|
return this._fail('INFRACTION_ERROR');
|
||||||
}
|
}
|
||||||
|
|
||||||
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, true));
|
|
||||||
|
|
||||||
return this._succeed();
|
return this._succeed();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user