mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-12-27 20:35:38 -05:00
Janky fix for console flood when incrementing levels
This commit is contained in:
parent
d5146b5c25
commit
77e07b7c28
@ -23,8 +23,8 @@ export default class userLevels extends Schema {
|
|||||||
await this._content.findByIdAndUpdate(userid, {messages: userData.messages + 1});
|
await this._content.findByIdAndUpdate(userid, {messages: userData.messages + 1});
|
||||||
if (userData.messages >= this.algorithm(userData.level+2)){
|
if (userData.messages >= this.algorithm(userData.level+2)){
|
||||||
while (userData.messages > this.algorithm(userData.level+1)){
|
while (userData.messages > this.algorithm(userData.level+1)){
|
||||||
const newData = await this._content.findByIdAndUpdate(userid, {level:userData.level+1}, {new: true});
|
const newData = await this._content.findByIdAndUpdate(userid, {level:userData.level++}, {new: true});
|
||||||
console.log(`${userid} EXTENDED LEVELUP ${newData?.level}`)
|
console.log(`${userid} extended to level ${newData.level}`);
|
||||||
}
|
}
|
||||||
} else if (userData.messages >= this.algorithm(userData.level+1)) {
|
} else if (userData.messages >= this.algorithm(userData.level+1)) {
|
||||||
const newData = await this._content.findByIdAndUpdate(userid, {level:userData.level+1}, {new: true});
|
const newData = await this._content.findByIdAndUpdate(userid, {level:userData.level+1}, {new: true});
|
||||||
|
Loading…
Reference in New Issue
Block a user