diff --git a/.gitignore b/.gitignore index 34e7611..5cfbe76 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ config.json node_modules -recordings \ No newline at end of file +recordings +.idea diff --git a/index.js b/index.js index 5509a94..f47b794 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,13 @@ const client = new Discord.Client(); const config = require('./config.json'); const commands = require(`./bin/commands`); +//in case the bot was not configured properly +if(!config.PREFIX || !config.BOT_TOKEN) { + console.error("Error: the configuration file was configured properly."); + console.error("Make sure there are no spelling mistakes."); + process.exit(1); +} + client.on('message', msg => { if (msg.content.startsWith(config.PREFIX)) { const commandBody = msg.content.substring(config.PREFIX.length).split(' ');