Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

290
Vistas
How to know what today is, in discord.js

I want to make bot that know what day is today, i have example code below but i dont know how to fix this.

  client.on("message", msg =>{
  if (msg.content === "!today"){
    If (Today is Sunday){
        msg.reply("Time to Holiday")
      }
    else if(Today is monday){
        msg.reply("Time to work")
      }
  }
 });
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

new Date() gives you the current date and time. It has a method .getDay() which gives you the day of the week as a number. Sunday is 0; Monday is 1. So:

const dayOfWeek = new Date().getDay();

if (dayOfWeek === 0) { // is it Sunday?

Note that this is the bot server date and time. Different users might be on different days, due to time zones.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda