mirror of
https://github.com/thelounge/thelounge
synced 2024-12-24 11:23:07 +00:00
20 lines
468 B
JavaScript
20 lines
468 B
JavaScript
var Chan = require("../models/chan");
|
|
var Msg = require("../models/msg");
|
|
|
|
module.exports = function(slate, network) {
|
|
var client = this;
|
|
slate.on("welcome", function(data) {
|
|
network.connected = true;
|
|
slate.write("PING " + network.host);
|
|
var chan = network.channels[0];
|
|
var msg = new Msg({
|
|
from: "-!-",
|
|
text: "You're now known as " + data,
|
|
});
|
|
chan.addMsg(msg);
|
|
client.emit("msg", {
|
|
id: chan.id,
|
|
msg: msg,
|
|
});
|
|
});
|
|
};
|