From 4000384f550acbffc593ac4cf03e46bae8c7673f Mon Sep 17 00:00:00 2001 From: AnxietyisReal <96593068+AnxietyisReal@users.noreply.github.com> Date: Sun, 26 Mar 2023 11:05:30 +1100 Subject: [PATCH] Janky fix for console flood when incrementing levels --- src/models/userLevels.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/models/userLevels.ts b/src/models/userLevels.ts index a4a61d9..5ebae20 100644 --- a/src/models/userLevels.ts +++ b/src/models/userLevels.ts @@ -23,8 +23,8 @@ export default class userLevels extends Schema { await this._content.findByIdAndUpdate(userid, {messages: userData.messages + 1}); if (userData.messages >= this.algorithm(userData.level+2)){ while (userData.messages > this.algorithm(userData.level+1)){ - const newData = await this._content.findByIdAndUpdate(userid, {level:userData.level+1}, {new: true}); - console.log(`${userid} EXTENDED LEVELUP ${newData?.level}`) + const newData = await this._content.findByIdAndUpdate(userid, {level:userData.level++}, {new: true}); + console.log(`${userid} extended to level ${newData.level}`); } } else if (userData.messages >= this.algorithm(userData.level+1)) { const newData = await this._content.findByIdAndUpdate(userid, {level:userData.level+1}, {new: true});