2020-02-24 19:12:22 +00:00
|
|
|
const fs = require('fs');
|
2020-02-24 19:13:02 +00:00
|
|
|
const path = require('path')
|
2020-02-24 19:12:22 +00:00
|
|
|
|
2020-02-24 19:11:27 +00:00
|
|
|
module.exports = {
|
|
|
|
name: 'reload',
|
2020-02-24 19:17:10 +00:00
|
|
|
alias: 'none',
|
2020-02-24 19:11:27 +00:00
|
|
|
usage: '',
|
|
|
|
description: 'Reload all files',
|
|
|
|
onlyDev: true,
|
|
|
|
permission: 'none',
|
|
|
|
category: 'util',
|
|
|
|
async execute(msg, args, client, Discord, prefix, command) {
|
|
|
|
const commandFiles = fs.readdirSync(path.join(path.dirname(__dirname), 'commands')).filter(f => f.endsWith('.js'));
|
|
|
|
for (const file of commandFiles) {
|
|
|
|
const command = require(`./${file}`);
|
|
|
|
command.uses = 0;
|
|
|
|
client.commands.set(command.name, command);
|
|
|
|
client.commandAliases.set(command.alias, command);
|
|
|
|
}
|
|
|
|
const settingFiles = fs.readdirSync(path.join(path.dirname(__dirname), 'commands/settings')).filter(f => f.endsWith('.js'));
|
|
|
|
for (const file of settingFiles) {
|
|
|
|
const option = require(`./settings/${file}`);
|
|
|
|
client.settingCmd.set(option.name, option);
|
|
|
|
}
|
2020-03-03 20:24:41 +00:00
|
|
|
/*fs.readdirSync(path.join(__dirname, 'funcs')).forEach(filename => {
|
2020-02-24 19:11:27 +00:00
|
|
|
this.funcs[filename.slice(0, -3)] = require(`../struct/funcs/${filename}`);
|
2020-03-03 20:24:41 +00:00
|
|
|
});*/
|
2020-03-12 11:56:31 +00:00
|
|
|
msg.channel.send(client.messages.reloaded);
|
2020-02-24 19:11:27 +00:00
|
|
|
}
|
|
|
|
};
|