From 1feb3f21f30a8ce686499580ac6eb5aab055f67b Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 24 Dec 2021 02:26:10 -0700 Subject: [PATCH] add dynamic cooldowns --- bot.js | 3 ++- commands/utility/remind.js | 2 ++ events/messageCreate.js | 1 + util/cooldownhandler.js | 17 +++++++++++++++++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 util/cooldownhandler.js diff --git a/bot.js b/bot.js index 4911143..0641227 100644 --- a/bot.js +++ b/bot.js @@ -43,7 +43,8 @@ client.misc = { charsNum: 0 }, loggers: {}, - rl: readline.createInterface({input: process.stdin, output: process.stdout}) + rl: readline.createInterface({input: process.stdin, output: process.stdout}), + cooldown: new Discord.Collection() }; //const config = require('./config.js'); diff --git a/commands/utility/remind.js b/commands/utility/remind.js index ede663b..04a7b14 100644 --- a/commands/utility/remind.js +++ b/commands/utility/remind.js @@ -11,12 +11,14 @@ module.exports = { syntax: '`remind `', extra: null }, + cooldown: {time: 5000, silent: false, message: "Slow down pal, I don't exactly have a world-star memory. Cool down on the reminders! (This command has a cooldown of 5s and you exceeded it)"}, help: new Discord.MessageEmbed() .setTitle("Help -> Reminders") .setDescription("Have me remind you about something later on.") .addField("Syntax", "`remind `"), async execute(message, msg, args, cmd, prefix, mention, client) { if (!args.length) {return message.channel.send(`Syntax: \`${prefix}remind