dist/botmaster.js
function setupBotStatus(bot, node) {
    var updates = 0;
    var replies = 0;
    var updateText = function updateText() {
        return updates !== 1 ? updates + ' updates' : updates + ' update';
    };
    var replyText= function replyText() {
        return replies !== 1 ? replies + ' replies': replies + ' reply';
    };
    var updateStatus = function updateStatus() {
        node.status({fill: 'green', shape: 'dot',
            text: updateText() + '; ' + replyText()
        });
    };
    node.status({fill: 'grey', shape: 'ring', text: 'inactive'});
    bot.on('update', function updateCallback() {
        updates += 1;
        updateStatus();
    });

    bot.on('error', function errorCallback(error) {
        node.error(error);
        node.status({fill: 'red', shape: 'dot', text: 'error'});
    });

    bot.use('outgoing', function outgoingCallback(bot, update, message, next) {
        replies += 1;
        updateStatus();
        next();
    });
}
function setupBotStatus(bot, node) {
    var updates = 0;
    var replies = 0;
    var updateText = function updateText() {
        return updates !== 1 ? updates + ' updates' : updates + ' update';
    };
    var replyText= function replyText() {
        return replies !== 1 ? replies + ' replies': replies + ' reply';
    };
    var updateStatus = function updateStatus() {
        node.status({fill: 'green', shape: 'dot',
            text: updateText() + '; ' + replyText()
        });
    };
    node.status({fill: 'grey', shape: 'ring', text: 'inactive'});
    bot.on('update', function updateCallback() {
        updates += 1;
        updateStatus();
    });

    bot.on('error', function errorCallback(error) {
        node.error(error);
        node.status({fill: 'red', shape: 'dot', text: 'error'});
    });

    bot.use('outgoing', function outgoingCallback(bot, update, message, next) {
        replies += 1;
        updateStatus();
        next();
    });
}
function setupBotStatus ( bot , node ) { var updates = 0 ; var replies = 0 ; var updateText = function updateText ( ) { return updates !== 1 ? updates + ' updates' : updates + ' update' ; } ; var replyText = function replyText ( ) { return replies !== 1 ? replies + ' replies' : replies + ' reply' ; } ; var updateStatus = function updateStatus ( ) { node . status ( { fill : 'green' , shape : 'dot' , text : updateText ( ) + '; ' + replyText ( ) } ) ; } ; node . status ( { fill : 'grey' , shape : 'ring' , text : 'inactive' } ) ; bot . on ( 'update' , function updateCallback ( ) { updates += 1 ; updateStatus ( ) ; } ) ; bot . on ( 'error' , function errorCallback ( error ) { node . error ( error ) ; node . status ( { fill : 'red' , shape : 'dot' , text : 'error' } ) ; } ) ; bot . use ( 'outgoing' , function outgoingCallback ( bot , update , message , next ) { replies += 1 ; updateStatus ( ) ; next ( ) ; } ) ; }
Show a little status next to each configured bot
Show a little status next to each configured bot