Simp-O-Matic

Dumb Discord bot in TS.
git clone git://git.knutsen.co/Simp-O-Matic
Log | Files | Refs | README | LICENSE

commit 53b367dc2265616c38b9370e357f8d3fcb7c6f82
parent 610a103e906d7ed06210ca4119e98fb80bfc6204
Author: Demonstrandum <moi@knutsen.co>
Date:   Thu, 28 May 2020 17:02:17 +0100

Merge branch 'master' of github.com:Demonstrandum/Simp-O-Matic

Diffstat:
Mlib/commands/cron.ts | 9++++++---
1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/lib/commands/cron.ts b/lib/commands/cron.ts @@ -137,6 +137,9 @@ export class Timer { now.setUTCHours(now.getHours() % 12); now.setSeconds(0); now.setMilliseconds(0); + + console.log('Now:', now); + return now.getTime(); } @@ -151,14 +154,14 @@ export class Timer { date.setSeconds(0); date.setDate(Number(dayOfMonth) - 1); + console.log('Job #', job.id, 'time:', date); + return date.getTime(); } compare(job: Cron): void { if (this.now === this.timestamp(job)) this.dispatch(job, this.now); - else - console.log('SKIPPED', this.now, this.timestamp(job)); } dispatch(job: Cron, timespan: number): void { @@ -168,7 +171,7 @@ export class Timer { console.log('Executed cron job #', job.id); this.homescope.message.content = - `${this.homescope.CONFIG.commands.prefix}${job.command.name} ${job.command.args.join(' ')}`; + `${job.command.name} ${job.command.args.join(' ')}`; job.executed_at = timespan;