From 998955ed79ad605f6990d554b35ef6d5b2d2e056 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Sun, 16 Apr 2023 15:31:02 +0200 Subject: [PATCH] Fix netload not working if there is no whitelist Closes #20 --- commands/misc/netload.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/commands/misc/netload.js b/commands/misc/netload.js index 48a1472..c7da5c6 100644 --- a/commands/misc/netload.js +++ b/commands/misc/netload.js @@ -14,6 +14,10 @@ module.exports = { "The bot operator also has to have this enabled in the config." ], execute({ message, args, prefix, client, owners }) { + //check if netload whitelist file exists + if (!fs.existsSync('./data/netmoduleWhitelist.json')) { + fs.writeFileSync('./data/netmoduleWhitelist.json', "[]") + } let json = fs.readFileSync('./data/netmoduleWhitelist.json', 'utf8'); let whitelist = JSON.parse(json) if (json.indexOf(message.author.id.toString()) == -1) {