1
0
mirror of https://github.com/musix-org/musix-oss synced 2024-11-10 08:10:18 +00:00
musix-oss/commands/reload.js
MatteZ02 a64f9d2325 Update 3.0.3
All messages reworked.
2020-03-12 13:56:31 +02:00

31 lines
1.2 KiB
JavaScript

const fs = require('fs');
const path = require('path')
module.exports = {
name: 'reload',
alias: 'none',
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);
}
/*fs.readdirSync(path.join(__dirname, 'funcs')).forEach(filename => {
this.funcs[filename.slice(0, -3)] = require(`../struct/funcs/${filename}`);
});*/
msg.channel.send(client.messages.reloaded);
}
};