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

107
Vistas
Node.JS command cooldown without discord.js

I have a simple node.js project in a folder with no extra stuff like discord or databases. For data storage i use json files. Now here's the question. How would i make a cooldown for a specific file for a specific user, but they still should be able to type in the terminal.

So like 'cooldown.js'

Could be run by someone called 'potato' and it works fine. Then it could be run by someone called 'potato2' and it works fine

( Name is defined by args[0].toLowerCase() )

But then if potato tries to run it again within a minute, it would print a message in output that he is still on cooldown. I'm thinking of a JSON file that remembers the last time you executed that command and if you do it again it compares it to the time in the JSON file and if its longer then 1 minute it removes it from the JSON file but i seriously have no idea how to do that. So that's why im asking here!

about 4 years ago · Juan Pablo Isaza
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