Remove netmodule functionality

This commit is contained in:
SileNce5k 2024-11-01 19:40:32 +01:00
parent 8d07effbe0
commit 5ec779b7a9
Signed by: SileNce
GPG key ID: B0A142BB4291B204
6 changed files with 4 additions and 109 deletions

View file

@ -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");

View file

@ -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);
}
}