viewing paste Unknown #26553 | Javascript

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
var botCommands = require('./commands.js')
 
client.on('chat', function(channel, user, message, self){
for(i=0;i<botCommands.length;i++) { 
    if(message.toLowerCase() === "!"+botCommands.botCommands[i].command){
        if(botCommands.botCommands[i].mod) {
            if(!(user["user-type"] != "mod" && user.username != channel.replace("#", ""))) {
                break;
            }
        }
        if(botCommands.botCommands[i].me) {
            if(user['display-name'] != "TheDerpySupport"){
                break;
            }
        }
        if(botCommands.botCommands[i].whisper) {
            client.whisper(user['display-name'], botCommands.botCommands[i].description);
        } else {
            client.say(channel, botCommands.botCommands[i].description);
        }
    }
}}
Viewed 824 times, submitted by Guest.