output next invocation time for scheduled jobs

This commit is contained in:
Chris Ham
2024-02-28 16:43:29 -08:00
parent abdc894359
commit 19c8f4fa85

View File

@@ -374,7 +374,7 @@ function init(config) {
console.log(
`Scheduling event ${event.id} for ${discordGuild.name}...`
);
schedule.scheduleJob(event.schedule, () => {
const job = schedule.scheduleJob(event.schedule, () => {
let payload = [];
if (pingRole !== false) {
payload.push(pingRole);
@@ -384,6 +384,7 @@ function init(config) {
}
channel.send(payload);
});
console.log(`Next invocation: ${job.nextInvocation()}`);
});
}
});