squelch-client
Version:
An IRC client for Node.js
26 lines (22 loc) • 698 B
JavaScript
// 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);