Make util use subdirfiles command on reload

This commit is contained in:
SileNce5k 2021-07-22 09:20:03 +02:00
parent 047ba95311
commit f448c63801
No known key found for this signature in database
GPG key ID: C507260E7F2583AD

View file

@ -5,7 +5,7 @@ const utilPath = 'util/'
module.exports = function (client) {
let utilFiles = fs.readdirSync(utilPath).filter(file => file.endsWith('.js'));
let utilFiles = getSubdirFiles(utilPath)
let commandFiles = getSubdirFiles(commandPath);
@ -14,7 +14,7 @@ module.exports = function (client) {
delete require.cache[require.resolve(`../${i}`)];
}
for (const i of utilFiles){
delete require.cache[require.resolve(`../${utilPath}${i}`)]
delete require.cache[require.resolve(`../${i}`)]
}
}
client.commands.clear()