avocadi-bot/src/actions/waterMe/waterMe.task.ts
2024-12-28 20:09:43 +01:00

17 lines
430 B
TypeScript

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