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

106
Views
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
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!