Skip to content Skip to sidebar Skip to footer

Sending Message To A Specific Channel At A Specific Time Using Cron In Discord

I want to send a message to a specific channel at 2:00 AM in Discord. I can't get it to work. Am I doing something wrong? Here's my code: const Discord = require('discord.js') cons

Solution 1:

This is okay now. Apparently, there's just 5 values in cron time string, and I put 6

Here's the code now:

let job = new cron.CronJob('00 2 * * *', () => {
client.channels.cache.get(channel).send("Hello!!")
})

Post a Comment for "Sending Message To A Specific Channel At A Specific Time Using Cron In Discord"