From e0879e45488743f22b0ac9bc51acd01704e510df Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Fri, 12 May 2023 20:53:20 +0300 Subject: [PATCH] fix for NaN totalpoints maybe --- src/structure/client/ModerationManager.js | 4 ++-- src/structure/client/wrappers/UserWrapper.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/structure/client/ModerationManager.js b/src/structure/client/ModerationManager.js index 13bd93f..687265b 100644 --- a/src/structure/client/ModerationManager.js +++ b/src/structure/client/ModerationManager.js @@ -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; diff --git a/src/structure/client/wrappers/UserWrapper.js b/src/structure/client/wrappers/UserWrapper.js index 79b7ecd..2831f2c 100644 --- a/src/structure/client/wrappers/UserWrapper.js +++ b/src/structure/client/wrappers/UserWrapper.js @@ -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;