mongo-cooldown

1.2.4 • Public • Published

mongo-cooldown

npm (scoped)

Set cooldowns for discord commands with mongoose

Install

npm install mongo-cooldown

Usage

const cooldowns = require("mongo-cooldown");

// add a cooldown
let cooldown = await cooldowns.addCoolDown("398314054147637248", 60000 * 60 * 24, "daily")
//=> Time cooldown ends

// Check 
let cooldown = await cooldowns.checkCoolDown("398314054147637248", "daily")
// Output: 
{
    ready: false, // if the cooldown is over
    time: milliseconds, // time remaining in milliseconds
    command: "daily", // command name
    unixTime: time // time left in unix timestamp 
}

Package Sidebar

Install

npm i mongo-cooldown

Weekly Downloads

0

Version

1.2.4

License

MIT

Unpacked Size

5.16 kB

Total Files

6

Last publish

Collaborators

  • thecharlee12