add aliases on single-cmd reload

master
Kit Kasune 3 years ago
parent c55cd01f06
commit 717868a192
  1. 4
      commands/dev/reload.js

@ -91,7 +91,9 @@ module.exports = {
}); });
if (!res) {return message.channel.send("I can't reload that command as I can't find file!");} if (!res) {return message.channel.send("I can't reload that command as I can't find file!");}
if (require.resolve(res) in require.cache) {delete require.cache[require.resolve(res)];} if (require.resolve(res) in require.cache) {delete require.cache[require.resolve(res)];}
client.commands.set(lf, require(res)); const ncmd = require(res);
client.commands.set(lf, ncmd);
if (ncmd.aliases) {ncmd.aliases.forEach(alias => {if (!client.aliases.has(alias)) {client.aliases.set(alias, lf);}});}
return message.channel.send(`Reloaded command \`${lf}\` in ${new Date().getTime() - timer}ms`); return message.channel.send(`Reloaded command \`${lf}\` in ${new Date().getTime() - timer}ms`);
} }

Loading…
Cancel
Save