Command Cooldowns
Commands should have a cooldown to reduce the number of times a user uses a command to prevent an issue called "Spamming".
How does cooldowns work?
cooldowns work?/**
* @type {import("nocli-handler.js").ICommand}
*/
const Command = {
description: "Checks client latency",
type: "BOTH",
cooldowns: {
// Set a command cooldown type listed in the documentation
}
callback: ({ client, message, args, text }) => {
return `π Pong! \`${client.ws.ping}ms\``;
}
}
module.exports = Command;import { ICommand } from "nocli-handler.js";
export default {
description: "Checks client latency",
type: "BOTH",
cooldowns: {
// Set a command cooldown type listed in the documentation
}
callback: ({ client, message, args, text }) => {
return `π Pong! \`${client.ws.ping}ms\``;
}
} as ICommand;What does these types of cooldowns help in?
Cooldown Type
Description
updateCooldown() and cancelCooldown() functions
updateCooldown() and cancelCooldown() functionsLast updated