mirror of
https://github.com/musix-org/musix-oss
synced 2024-11-10 05:10:17 +00:00
Create reload.js
This commit is contained in:
parent
fbee737e4e
commit
1a0fe6ee2d
27
commands/reload.js
Normal file
27
commands/reload.js
Normal file
@ -0,0 +1,27 @@
|
||||
module.exports = {
|
||||
name: 'reload',
|
||||
alias: 'reload',
|
||||
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('All files reloaded!');
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue
Block a user