title: Can I limit the amount of command usages in Discord.js?
body: <p>I am currently making a Discord bot for my friends, and I want to limit the amount of times they can use a particular command every hour. I am using the jsoning npm package for a database, but I am having troubles resetting it. I have it storing the usage amount in a database by their ID, and this is where I run into a problem trying to reset all the usage amounts at the same time. This is the code I have for a work command, and it shows how I am storing the usage amounts. Any help is appreciated. Thanks!</p>
  <pre><code>if (command === 'work') { 
      if(await database.has(`uses${message.author.id}`) == false) await database.set(`uses${message.author.id}`, 3)
      var starting = await database.get(`uses${message.author.id}`)
      if(starting &lt; 1) return message.channel.send('**Please wait until next hour to use again!**')
      await database.math(`uses${message.author.id}`, 'subtract', 1)
      var output = await eco.Work(message.author.id, {
        failurerate: 20,
        money: Math.floor(Math.random() * 500),
        jobs: [mechanic, subway worker]
      })
      //10% chance to fail and earn nothing. You earn between 1-500 coins. And you get one of those 3 random jobs.
      if (output.earned == 0) return message.reply('**You did your job so well so you earned nothing!**')
   
      message.channel.send(`**${message.author.username}
  You worked as a \` ${output.job} \` and earned  w$${output.earned}
  You now own w$${output.balance}**`)
    }```
  </code></pre>