diff --git a/src/timers/GiveCurrency.ts b/src/timers/GiveCurrency.ts index c292025..93e48d1 100644 --- a/src/timers/GiveCurrency.ts +++ b/src/timers/GiveCurrency.ts @@ -3,15 +3,17 @@ import CardConstants from "../constants/CardConstants"; import User from "../database/entities/app/User"; export default async function GiveCurrency() { - AppLogger.LogInfo("Timers/GiveCurrency", "Giving currency to every known user"); + AppLogger.LogDebug("Timers/GiveCurrency", "Giving currency to every known user"); const users = await User.FetchAll(User); - for (const user of users) { + const usersFiltered = users.filter(x => x.Currency < 1000); + + for (const user of usersFiltered) { user.AddCurrency(CardConstants.TimerGiveAmount); } User.SaveAll(User, users); - AppLogger.LogInfo("Timers/GiveCurrency", `Successfully gave +${CardConstants.TimerGiveAmount} currency to ${users.length} users`); + AppLogger.LogDebug("Timers/GiveCurrency", `Successfully gave +${CardConstants.TimerGiveAmount} currency to ${usersFiltered.length} users`); } \ No newline at end of file