You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Haha-Yes/commands/reload.js

17 lines
611 B
JavaScript

exports.run = (client, message, args) => {
if (message.author.id == "267065637183029248") {
if(!args || args.size < 1) return message.reply("Must provide a command name to reload.");
const commandName = args[0];
if(!client.commands.has(commandName)) {
return message.reply("That command does not exist");
}
delete require.cache[require.resolve(`./${commandName}.js`)];
client.commands.delete(commandName);
const props = require(`./${commandName}.js`);
client.commands.set(commandName, props);
message.reply(`The command ${commandName} has been reloaded`);
};
}