godjjchrome/js/tmi.js
// Timeout username on channel for X seconds..
Timeout username on channel for X seconds
Timeout username on channel for X seconds
function timeout(channel, username, seconds, reason) {
        var _this21 = this;
        channel = _.channel(channel);
        username = _.username(username);
        if (!_.isNull(seconds) && !_.isInteger(seconds)) {
            reason = seconds;
            seconds = 300;
        }
        seconds = _.get(seconds, 300);
        reason = _.get(reason, "");
        return this._sendCommand(this._getPromiseDelay(), channel, "/timeout " + username + " " + seconds + " " + reason, function (resolve, reject) {
            _this21.once("_promiseTimeout", function (err) {
                if (!err) {
                    resolve([channel, username, ~~seconds, reason]);
                } else {
                    reject(err);
                }
            });
        });
    }
function timeout ( channel , username , seconds , reason ) { var _this21 = this ; channel = _ . channel ( channel ) ; username = _ . username ( username ) ; if ( ! _ . isNull ( seconds ) && ! _ . isInteger ( seconds ) ) { reason = seconds ; seconds = 300 ; } seconds = _ . get ( seconds , 300 ) ; reason = _ . get ( reason , "" ) ; return this . _sendCommand ( this . _getPromiseDelay ( ) , channel , "/timeout " + username + " " + seconds + " " + reason , function ( resolve , reject ) { _this21 . once ( "_promiseTimeout" , function ( err ) { if ( ! err ) { resolve ( [ channel , username , ~ ~ seconds , reason ] ) ; } else { reject ( err ) ; } } ) ; } ) ; }
Timeout username on channel for X seconds..
Timeout username on channel for X seconds ..
// Send the command to the server and race the Promise against a delay.. // Received _promiseTimeout event, resolve or reject..