var botCommandsFile = require('./commands.js');
var botCommands = new botCommandsFile.botCommands
client.on('chat', function(channel, user, message, self){
for(i=0;i<botCommands.length;i++) {
if(message.toLowerCase() === "!"+botCommands[i].command){
if(botCommands[i].mod) {
if(!(user["user-type"] != "mod" && user.username != channel.replace("#", ""))) {
break;
}
}
if(botCommands[i].me) {
if(user['display-name'] != "TheDerpySupport"){
break;
}
}
if(botCommands[i].whisper) {
client.whisper(user['display-name'], "" + botCommands[i].description + "");
} else {
client.say(channel, botCommands[i].description);
}
}
}
}