From af982f8611146cb4b99cd70cc6f1b1b656bc5426 Mon Sep 17 00:00:00 2001 From: rainbow napkin Date: Sat, 26 Apr 2025 18:50:19 -0400 Subject: [PATCH] Add math.floor() function call to setHighLevel() --- src/app/channel/chatHandler.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/app/channel/chatHandler.js b/src/app/channel/chatHandler.js index c9d07ef..3da520a 100644 --- a/src/app/channel/chatHandler.js +++ b/src/app/channel/chatHandler.js @@ -14,6 +14,9 @@ GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License along with this program. If not, see .*/ +//NPM imports +const validator = require('validator') + //local imports const commandPreprocessor = require('./commandPreprocessor'); const loggerUtils = require('../../utils/loggerUtils'); @@ -63,8 +66,8 @@ module.exports = class{ if(userDB){ try{ - //Set high level - userDB.highLevel = data.highLevel; + //Floor input to an integer and set high level + userDB.highLevel = Math.floor(data.highLevel); //Save user DB Document await userDB.save();