Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

108
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda