godjjchrome/js/tmi.js
// Get list of mods on a channel..
Get list of mods on a channel
Get list of mods on a channel
function mods(channel) {
        var _this17 = this;
        channel = _.channel(channel);
        return this._sendCommand(this._getPromiseDelay(), channel, "/mods", function (resolve, reject) {
            _this17.once("_promiseMods", function (err, mods) {
                if (!err) {
                    mods.forEach(function (username) {
                        if (!_this17.moderators[channel]) {
                            _this17.moderators[channel] = [];
                        }
                        if (_this17.moderators[channel].indexOf(username) < 0) {
                            _this17.moderators[channel].push(username);
                        }
                    });
                    resolve(mods);
                } else {
                    reject(err);
                }
            });
        });
    }
function mods ( channel ) { var _this17 = this ; channel = _ . channel ( channel ) ; return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , "/mods" , function ( resolve , reject ) { _this17 . once ( "_promiseMods" , function ( err , mods ) { if ( ! err ) { mods . forEach ( function ( username ) { if ( ! _this17 . moderators [ channel ] ) { _this17 . moderators [ channel ] = [ ] ; } if ( _this17 . moderators [ channel ] . indexOf ( username ) < 0 ) { _this17 . moderators [ channel ] . push ( username ) ; } } ) ; resolve ( mods ) ; } else { reject ( err ) ; } } ) ; } ) ; }
Get list of mods on a channel..
Get list of mods on a channel ..
// Send the command to the server and race the Promise against a delay.. // Received _promiseMods event, resolve or reject.. // Update the internal list of moderators..