Like the following code from our [Friday BOT](https://github.com/wechaty/friday/blob/f728c5fd2b49930a9d192c0f03356db606aeb1a2/src/plugins/crontab.ts) demonstrated: (original author: @qhduan ) ```ts import cron from 'node-cron' interface CRONConfig { time: string, reply: string } const CRON_CONFIG: CRONConfig[] = [ { reply: '星期一了,如果主席还没发活动总结的话要注意了', /** * 定时任务 * ┌─────────────── second (optional) * │ ┌───────────── minute * │ │ ┌─────────── hour * │ │ │ ┌──────── day of month * │ │ │ │ ┌────── month * │ │ │ │ │ ┌──── day of week * │ │ │ │ │ │ * │ │ │ │ │ │ * * * * * * * // */ time: '0 0 19 * * 1', }, ] /** * TODO: Huan(202006) */ export async function crontab () { for (const cronConfig of CRON_CONFIG) { cron.schedule(cronConfig.time, async () => { // await Chatops.instance().say(cronConfig.reply) }) } } ``` See: - https://godoc.org/github.com/robfig/cron#hdr-CRON_Expression_Format
Activity
[-]NewPlugin: Contab[/-][+]NewPlugin: Crontab[/+]