hardlounge/server/plugins/irc-events/welcome.ts
Max Leiter dd05ee3a65
TypeScript and Vue 3 (#4559)
Co-authored-by: Eric Nemchik <eric@nemchik.com>
Co-authored-by: Pavel Djundik <xPaw@users.noreply.github.com>
2022-06-18 17:25:21 -07:00

24 lines
484 B
TypeScript

import {IrcEventHandler} from "../../client";
import Msg from "../../models/msg";
export default <IrcEventHandler>function (irc, network) {
const client = this;
irc.on("registered", function (data) {
network.setNick(data.nick);
const lobby = network.channels[0];
const msg = new Msg({
text: "You're now known as " + data.nick,
});
lobby.pushMessage(client, msg);
client.save();
client.emit("nick", {
network: network.uuid,
nick: data.nick,
});
});
};