updated log

This commit is contained in:
Miodec 2023-05-17 13:17:52 +02:00
parent a08be965f3
commit 82bfc5956e

View file

@ -777,13 +777,15 @@ export async function recordAutoBanEvent(
const updateObj: Partial<MonkeyTypes.User> = {
autoBanTimestamps: recentAutoBanTimestamps,
};
let banningUser = false;
if (recentAutoBanTimestamps.length > maxCount) {
updateObj.banned = true;
banningUser = true;
ret = true;
}
await getUsersCollection().updateOne({ uid }, { $set: updateObj });
Logger.logToDb("user_auto_banned", { autoBanTimestamps }, uid);
Logger.logToDb("user_auto_banned", { autoBanTimestamps, banningUser }, uid);
return ret;
}