Cooldowns

You can use command cooldowns to ensure your commands are only ran every so often. Each cooldown type requires a string for it's duration and duration type (seconds, minutes, etc)

There are 4 types of cooldowns:

Example of per-user cooldowns:

daily.js
const { CommandType, CooldownTypes } = require("wokcommands");

module.exports = {
  description: "Ping pong command",

  type: CommandType.BOTH,

  cooldowns: {
    type: CooldownTypes.perUser,
    duration: "1 d",
  },

  callback: () => {
    return {
      content: "Pong!",
    };
  },
};

Last updated