diff --git a/commands/custom.js b/commands/custom.js index adcf54b..56881aa 100644 --- a/commands/custom.js +++ b/commands/custom.js @@ -13,6 +13,10 @@ module.exports = { "custom list - list all custom commands" ], execute({message, args, client}) { + const customPath = './data/customCommands.json'; + if(!fs.existsSync(customPath)){ + fs.writeFileSync(customPath,"[]") + } let sendText; if (args){ let customName = args[1]; diff --git a/util/addCustomCommand.js b/util/addCustomCommand.js index 17fefe7..c25bd7c 100644 --- a/util/addCustomCommand.js +++ b/util/addCustomCommand.js @@ -2,9 +2,6 @@ const fs = require('fs'); module.exports = function(customName, customMessage, author){ let sendText; const customPath = './data/customCommands.json'; - if(!fs.existsSync(customPath)){ - fs.writeFileSync(customPath,"[]") - } let json = fs.readFileSync(customPath, 'utf8'); let customCommands = JSON.parse(json)