Fix totalPoints not showing in infraction embed

This commit is contained in:
nolan 2021-06-12 00:34:23 -07:00
parent 9e5508781a
commit 0dc63e1d97
3 changed files with 7 additions and 4 deletions

View File

@ -163,14 +163,16 @@ class ModerationManager {
responses.push(await escalation.execute());
continue;
} else {
infraction.totalPoints = await userTarget.totalPoints(message.guild, { points, expiration, timestamp: infraction.timestamp });
}
}
infraction.totalPoints = await userTarget.totalPoints(message.guild, { points, expiration, timestamp: infraction.timestamp });
}
responses.push(await infraction.execute());
}
const success = Boolean(responses.some((r) => !r.error));

View File

@ -37,7 +37,6 @@ class SlowmodeInfraction extends Infraction {
rateLimitPerUser: this.data.seconds
}, this._reason);
} catch(e) {
console.error(e);
return this._fail('INFRACTION_ERROR');
}

View File

@ -156,7 +156,7 @@ class Infraction {
}
if(this.points && this.points > 0) { //TODO: Add expiration to INFRACTION_DESCRIPTIONPOINTS
description += `\n${this.guild.format('INFRACTION_DESCRIPTIONPOINTS', { points: this.points, total: this.pointsTotal, expires: Util.duration(this.pointsExpiration) })}`;
description += `\n${this.guild.format('INFRACTION_DESCRIPTIONPOINTS', { points: this.points, total: this.totalPoints, expires: Util.duration(this.pointsExpiration) })}`;
}
if(this.description && this.description instanceof Function) {
@ -206,6 +206,8 @@ class Infraction {
reason: this.reason,
data: this.data,
flags: this.flags,
points: this.points,
expiration: this.expiration,
modLogMessage: this.modlogMessageId,
dmLogMessage: this.dmlogMessageId,
modLogChannel: this.modlogId,