Files
bot/src/tasks/greeting.task.ts
moriese c06ac10d09 wip
2024-12-27 01:23:35 +01:00

17 lines
428 B
TypeScript

import { CronJob } from "cron";
import { GreetingService } from "services/greeting.service";
const greetingService = new GreetingService();
new CronJob(
"0 */1 * * * *", // cronTime
async () => {
console.log("called greeting");
await greetingService.greet();
}, // onTick
null, // onComplete
true, // start
"Europe/Berlin", // timeZone
);
// job.start() is optional here because of the fourth parameter set to true.