1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 04:10:59 -05:00

Janky fix for console flood when incrementing levels

This commit is contained in:
AnxietyisReal 2023-03-26 11:05:30 +11:00
parent 63ff193fa7
commit ed5d365259

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