forked from Galactic/galactic-bot
fix for NaN totalpoints maybe
This commit is contained in:
parent
289d3c7f3b
commit
e0879e4548
@ -249,8 +249,8 @@ class ModerationManager {
|
||||
let points = 0,
|
||||
expiration = 0;
|
||||
if (modpoints.enabled) {
|
||||
points = info.points || modpoints.points[type];
|
||||
expiration = info.expiration || modpoints.expirations[type];
|
||||
points = (info.points || modpoints.points[type]) ?? 0;
|
||||
expiration = (info.expiration || modpoints.expirations[type]) ?? 0;
|
||||
if(reason) for (const [phrase, amount] of Object.entries(modpoints.associations)) {
|
||||
if (reason.toLowerCase().includes(phrase)) {
|
||||
points = amount;
|
||||
|
@ -42,7 +42,7 @@ class UserWrapper {
|
||||
filter,
|
||||
{ projection: { id: 1, points: 1, expiration: 1 } }
|
||||
);
|
||||
|
||||
|
||||
if (find.length) {
|
||||
for (const { points: p, expiration, id } of find) {
|
||||
let points = p;
|
||||
|
Loading…
Reference in New Issue
Block a user