start of a cooldown system
This commit is contained in:
parent
93e5d74c94
commit
0809a6e0cc
1 changed files with 2 additions and 0 deletions
|
@ -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`)];
|
||||
|
|
Loading…
Reference in a new issue