mirror of
https://github.com/SEPPDROID/zoizbot.git
synced 2025-10-24 08:54:19 +00:00
29 lines
1.4 KiB
JavaScript
29 lines
1.4 KiB
JavaScript
/*
|
|
* a command that reloads the command you have edited to memory
|
|
* so you dont have to reboot the bot
|
|
* good for testing, not so much for production
|
|
* ive added the permission test, to make sure not everybody spams reload
|
|
*/
|
|
exports.run = (zoizbot, message, args) => {
|
|
const config = require("../conf.json");
|
|
message.channel.send({ embed: { "title": "Reload Tool", "color": 15746887, "fields": [{ "name": "Reload command file Syntax", "value": ` \n${config.prefix}reloadmoderation "command"\n${config.prefix}reloadgeneral "command" \n${config.prefix}reloadfun "command"` }] } });
|
|
|
|
|
|
/*
|
|
* uncomment if you have commandfiles in de /commands folder
|
|
* i did it the easy way. so should you haha
|
|
*
|
|
if (!message.member.hasPermission("ADMINISTRATOR"))
|
|
return message.reply("Sorry, you don't have permissions to use this!");
|
|
if (!args || args.length < 1) return message.reply("Please provide the command name to reload.");
|
|
const commandName = args[0];
|
|
if (!zoizbot.commands.has(commandName)) {
|
|
return message.reply("That command does not exist");
|
|
}
|
|
delete require.cache[require.resolve(`./${commandName}.js`)];
|
|
zoizbot.commands.delete(commandName);
|
|
const props = require(`./${commandName}.js`);
|
|
zoizbot.commands.set(commandName, props);
|
|
message.reply(`The command ${commandName} has been reloaded`);
|
|
*/
|
|
}; |