Remove netmodule functionality
This commit is contained in:
parent
8d07effbe0
commit
5ec779b7a9
6 changed files with 4 additions and 109 deletions
|
@ -6,8 +6,7 @@ module.exports = function () {
|
|||
"enableLoginMessage": false,
|
||||
"loginChannel" : "",
|
||||
"loginMessage" : "Bot is online!",
|
||||
"owners": [],
|
||||
"allowNetload" : false
|
||||
"owners": []
|
||||
}
|
||||
|
||||
if(!fs.existsSync("./data/")) fs.mkdirSync("./data");
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
const fs = require('fs')
|
||||
const netloadDir = 'netload/'
|
||||
|
||||
|
||||
module.exports = function (client) {
|
||||
if (!fs.existsSync(netloadDir)) fs.mkdirSync(netloadDir);
|
||||
let commandFiles = fs.readdirSync(netloadDir).filter(file => file.endsWith('.js'));
|
||||
if (client.netmodules.size != 0) {
|
||||
for (const i of commandFiles) {
|
||||
delete require.cache[require.resolve(`../${netloadDir}${i}`)];
|
||||
}
|
||||
}
|
||||
client.netmodules.clear()
|
||||
for (const file of commandFiles) {
|
||||
const command = require(`../${netloadDir}${file}`);
|
||||
client.netmodules.set(command.name, command);
|
||||
}
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue