Shuo/lib/plugins/irc-events/welcome.js

19 lines
419 B
JavaScript
Raw Normal View History

2014-06-29 19:41:02 +00:00
var Msg = require("../../models/msg");
module.exports = function(irc, network) {
var client = this;
irc.on("welcome", function(data) {
network.connected = true;
irc.write("PING " + network.host);
var lobby = network.channels[0];
var msg = new Msg({
text: "You're now known as " + data
});
lobby.messages.push(msg);
client.emit("msg", {
chan: lobby.id,
msg: msg
});
});
2014-06-26 23:05:47 +00:00
};