This commit is contained in:
Alex 2021-05-03 00:27:38 -07:00
parent 072c7e6efa
commit bc519f4741
2 changed files with 9 additions and 1 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
config.json
node_modules
recordings
.idea

View file

@ -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(' ');