1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-12-27 04:15:38 -05:00

Janky fix for console flood when incrementing levels

This commit is contained in:
toast-ts 2023-03-26 11:05:30 +11:00
parent d5146b5c25
commit 77e07b7c28

View File

@ -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});