diff --git a/src/helpers/TimerHelper.ts b/src/helpers/TimerHelper.ts index c5b1071..535a6a7 100644 --- a/src/helpers/TimerHelper.ts +++ b/src/helpers/TimerHelper.ts @@ -1,11 +1,12 @@ import { CronJob } from "cron"; import { v4 } from "uuid"; +import { Primitive } from "../type/primitive"; interface Timer { id: string; job: CronJob; - context: Map; - onTick: ((context: Map) => void) | ((context: Map) => Promise); + context: Map; + onTick: ((context: Map) => void) | ((context: Map) => Promise); runOnStart: boolean; } @@ -19,9 +20,9 @@ export default class TimerHelper { public AddTimer( cronTime: string, timeZone: string, - onTick: ((context: Map) => void) | ((context: Map) => Promise), + onTick: ((context: Map) => void) | ((context: Map) => Promise), runOnStart: boolean = false): string { - const context = new Map(); + const context = new Map(); const job = new CronJob( cronTime, diff --git a/src/timers/GiveCurrency.ts b/src/timers/GiveCurrency.ts index 9a0d28a..ad1a21a 100644 --- a/src/timers/GiveCurrency.ts +++ b/src/timers/GiveCurrency.ts @@ -1,7 +1,7 @@ import AppLogger from "../client/appLogger"; import User from "../database/entities/app/User"; -export default async function GiveCurrency(context: Map) { +export default async function GiveCurrency() { AppLogger.LogInfo("Timers/GiveCurrency", "Giving currency to every known user"); const users = await User.FetchAll(User); diff --git a/src/type/primitive.ts b/src/type/primitive.ts new file mode 100644 index 0000000..b1e143b --- /dev/null +++ b/src/type/primitive.ts @@ -0,0 +1 @@ +export type Primitive = string | number | boolean; \ No newline at end of file