forked from Galactic/galactic-bot
fix for no dms when removed from server
This commit is contained in:
parent
5b4efc566f
commit
f94566edbf
@ -34,6 +34,7 @@ class BanInfraction extends Infraction {
|
||||
let days = 0;
|
||||
if (this.message && this.message._caller === 'hardban') days = 1;
|
||||
if (this.arguments.days) days = this.arguments.days.value;
|
||||
await this.handle();
|
||||
|
||||
try {
|
||||
await this.guild.members.ban(this.target.id, {
|
||||
@ -49,7 +50,6 @@ class BanInfraction extends Infraction {
|
||||
|
||||
if (callbacks.size > 0) callbacks.map((c) => this.client.moderationManager.removeCallback(c));
|
||||
|
||||
await this.handle();
|
||||
return this._succeed();
|
||||
|
||||
}
|
||||
@ -72,8 +72,8 @@ class BanInfraction extends Infraction {
|
||||
}
|
||||
|
||||
async resolve(...args) {
|
||||
const infraction = await this.client.moderationManager.findLatestInfraction(this.type, this.targetId);
|
||||
const callback = this.client.moderationManager.callbacks.get(infraction.id);
|
||||
// const infraction = await this.client.moderationManager.findLatestInfraction(this.type, this.targetId);
|
||||
const callback = this.client.moderationManager.callbacks.get(this.id);
|
||||
if (callback) this.client.moderationManager.removeCallback(callback);
|
||||
|
||||
const banned = await this.guild.bans.fetch(this.targetId).catch(() => null);
|
||||
|
@ -34,13 +34,14 @@ class KickInfraction extends Infraction {
|
||||
|
||||
async execute() {
|
||||
|
||||
await this.handle();
|
||||
|
||||
try {
|
||||
await this.member.kick(this._reason);
|
||||
} catch (error) {
|
||||
return this._fail('INFRACTION_ERROR');
|
||||
}
|
||||
|
||||
await this.handle();
|
||||
return this._succeed();
|
||||
|
||||
}
|
||||
|
@ -31,6 +31,7 @@ class SoftbanInfraction extends Infraction {
|
||||
|
||||
let days = 1;
|
||||
if (this.arguments.days) days = this.arguments.days.value;
|
||||
await this.handle();
|
||||
|
||||
try {
|
||||
await this.guild.members.ban(this.target.id, {
|
||||
@ -42,7 +43,6 @@ class SoftbanInfraction extends Infraction {
|
||||
return this._fail('INFRACTION_ERROR');
|
||||
}
|
||||
|
||||
await this.handle();
|
||||
return this._succeed();
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user