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()); responses.push(await escalation.execute());
continue; 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()); responses.push(await infraction.execute());
} }
const success = Boolean(responses.some((r) => !r.error)); const success = Boolean(responses.some((r) => !r.error));

View File

@ -37,7 +37,6 @@ class SlowmodeInfraction extends Infraction {
rateLimitPerUser: this.data.seconds rateLimitPerUser: this.data.seconds
}, this._reason); }, this._reason);
} catch(e) { } catch(e) {
console.error(e);
return this._fail('INFRACTION_ERROR'); 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 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) { if(this.description && this.description instanceof Function) {
@ -206,6 +206,8 @@ class Infraction {
reason: this.reason, reason: this.reason,
data: this.data, data: this.data,
flags: this.flags, flags: this.flags,
points: this.points,
expiration: this.expiration,
modLogMessage: this.modlogMessageId, modLogMessage: this.modlogMessageId,
dmLogMessage: this.dmlogMessageId, dmLogMessage: this.dmlogMessageId,
modLogChannel: this.modlogId, modLogChannel: this.modlogId,