Add math.floor() function call to setHighLevel()

This commit is contained in:
rainbow napkin 2025-04-26 18:50:19 -04:00
parent 9bf68a499b
commit af982f8611

View file

@ -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 You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.*/ along with this program. If not, see <https://www.gnu.org/licenses/>.*/
//NPM imports
const validator = require('validator')
//local imports //local imports
const commandPreprocessor = require('./commandPreprocessor'); const commandPreprocessor = require('./commandPreprocessor');
const loggerUtils = require('../../utils/loggerUtils'); const loggerUtils = require('../../utils/loggerUtils');
@ -63,8 +66,8 @@ module.exports = class{
if(userDB){ if(userDB){
try{ try{
//Set high level //Floor input to an integer and set high level
userDB.highLevel = data.highLevel; userDB.highLevel = Math.floor(data.highLevel);
//Save user DB Document //Save user DB Document
await userDB.save(); await userDB.save();