UNPKG

squelch-client

Version:
26 lines (22 loc) 698 B
// Generated by CoffeeScript 1.10.0 (function() { var getReplyCode; getReplyCode = require('../../replies').getReplyCode; module.exports = function() { return function(client) { return client._.internalEmitter.on('raw', function(reply) { if (reply.command === getReplyCode('RPL_MOTD')) { client._.MOTD += reply.params[1] + '\r\n'; } if (reply.command === getReplyCode('RPL_MOTDSTART')) { client._.MOTD = reply.params[1] + '\r\n'; } if (reply.command === getReplyCode('RPL_ENDOFMOTD')) { return client.emit('motd', { motd: client._.MOTD }); } }); }; }; }).call(this);