hardlounge/server/plugins/irc-events/welcome.ts

24 lines
483 B
TypeScript
Raw Permalink Normal View History

import {IrcEventHandler} from "../../client";
import Msg from "../../models/msg";
2014-09-13 21:29:45 +00:00
export default <IrcEventHandler>function (irc, network) {
const client = this;
irc.on("registered", function (data) {
2016-05-12 11:15:38 +00:00
network.setNick(data.nick);
const lobby = network.getLobby();
const msg = new Msg({
text: "You're now known as " + data.nick,
2014-09-13 21:29:45 +00:00
});
lobby.pushMessage(client, msg);
2014-10-11 23:59:01 +00:00
client.save();
2014-09-25 23:51:53 +00:00
client.emit("nick", {
network: network.uuid,
nick: data.nick,
2014-09-25 23:51:53 +00:00
});
2014-09-13 21:29:45 +00:00
});
};