Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

117
Views
How to make a message send on certain days and hours on discord.js v13

All my code hasn't worked yet and was wondering how I could do it

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The way you ask is too broad for Stack overflow, like what user @kevintechie said. Anyway, for sending a message at a specific time, I recommend using Cron

The possible varibles of Cron are:

Seconds: 0-59

Minutes: 0-59

Hours: 0-23

Day of Month: 1-31

Months: 0-11 (January - December)

Day of Week: 0-6 (Sunday - Saturday)

Lets say you want to send a message everyday at 6 AM, using your local time

var cron = require("cron");

client.on('message', ...); //you don't have to add anything to the message listener

let morning = new cron.CronJob('00 00 06 * * *', () => {
  // Everyday at 6 AM, it will do something you want to it to do
  let channel = yourGuild.channels.get('id');
  channel.send('Morning everyone');
});
// to start the reminder
morning.start()
// to stop the reminder
morning.stop()

Else if you want it to remind from Mon to Fri, then it would be ...new cron.CronJob('00 00 06 * * 1-5', ()=> {...

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!