Compare commits

..

No commits in common. "981acefcf638e6ce797aaac68f13621030577eaf" and "caa991a259fd2191886d6149dfa3f15274b6b560" have entirely different histories.

3 changed files with 3 additions and 7 deletions

View file

@ -79,7 +79,7 @@ export class CoreClient extends Client {
.then(() => {
AppLogger.LogInfo("Client", "App Data Source Initialised");
const timerId = this._timerHelper.AddTimer("*/20 * * * *", "Europe/London", GiveCurrency, false);
const timerId = this._timerHelper.AddTimer("*/30 * * * * *", "Europe/London", GiveCurrency, false);
this._timerHelper.StartTimer(timerId);
})
.catch(err => {

View file

@ -1,3 +0,0 @@
export default class CardConstants {
public static readonly TimerGiveAmount = 10;
}

View file

@ -1,5 +1,4 @@
import AppLogger from "../client/appLogger";
import CardConstants from "../constants/CardConstants";
import User from "../database/entities/app/User";
export default async function GiveCurrency() {
@ -8,10 +7,10 @@ export default async function GiveCurrency() {
const users = await User.FetchAll(User);
for (const user of users) {
user.AddCurrency(CardConstants.TimerGiveAmount);
user.AddCurrency(5);
}
User.SaveAll(User, users);
AppLogger.LogInfo("Timers/GiveCurrency", `Successfully gave +${CardConstants.TimerGiveAmount} currency to ${users.length} users`);
AppLogger.LogInfo("Timers/GiveCurrency", `Successfully gave +5 currency to ${users.length} users`);
}