From 0809a6e0cce761caf9159a6bccd18900e5b21e95 Mon Sep 17 00:00:00 2001 From: Emily J Date: Wed, 21 Oct 2020 18:57:35 +1100 Subject: [PATCH] start of a cooldown system --- bot/util/commandLoader.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bot/util/commandLoader.js b/bot/util/commandLoader.js index b75021a..3560425 100644 --- a/bot/util/commandLoader.js +++ b/bot/util/commandLoader.js @@ -15,6 +15,7 @@ class CommandLoader { const command = new (require(this.client.path + '/commands/' + file))(name, category); this.client.commands.set(command.name, command); + this.client.cooldowns.set(command.name, new Map()); command.aliases.forEach(alias => { this.client.aliases.set(alias, command.name); }); @@ -28,6 +29,7 @@ class CommandLoader { // Reloads all currently loaded commands, so we don't need to restart to apply changes reloadCommands () { + this.client.cooldowns.clear(); this.client.commands.forEach(cmd => { try { delete require.cache[require.resolve(`${this.client.path}/commands/${cmd.category}/${cmd.name}.js`)];