thelounge/src/plugins/irc-events/welcome.js

24 lines
442 B
JavaScript
Raw Normal View History

"use strict";
const Msg = require("../../models/msg");
2014-09-13 23:29:45 +02:00
module.exports = function (irc, network) {
const client = this;
irc.on("registered", function (data) {
2016-05-12 13:15:38 +02:00
network.setNick(data.nick);
const lobby = network.channels[0];
const msg = new Msg({
text: "You're now known as " + data.nick,
2014-09-13 23:29:45 +02:00
});
lobby.pushMessage(client, msg);
2014-10-12 01:59:01 +02:00
client.save();
2014-09-26 01:51:53 +02:00
client.emit("nick", {
network: network.uuid,
nick: data.nick,
2014-09-26 01:51:53 +02:00
});
2014-09-13 23:29:45 +02:00
});
};