dd05ee3a65
Co-authored-by: Eric Nemchik <eric@nemchik.com> Co-authored-by: Pavel Djundik <xPaw@users.noreply.github.com>
29 lines
666 B
TypeScript
29 lines
666 B
TypeScript
import {IrcEventHandler} from "../../client";
|
|
|
|
import Msg, {MessageType} from "../../models/msg";
|
|
|
|
export default <IrcEventHandler>function (irc, network) {
|
|
const client = this;
|
|
|
|
irc.on("loggedin", (data) => {
|
|
const lobby = network.channels[0];
|
|
|
|
const msg = new Msg({
|
|
type: MessageType.LOGIN,
|
|
// eslint-disable-next-line @typescript-eslint/restrict-plus-operands
|
|
text: "Logged in as: " + data.account,
|
|
});
|
|
lobby.pushMessage(client, msg, true);
|
|
});
|
|
|
|
irc.on("loggedout", () => {
|
|
const lobby = network.channels[0];
|
|
|
|
const msg = new Msg({
|
|
type: MessageType.LOGOUT,
|
|
text: "Logged out",
|
|
});
|
|
lobby.pushMessage(client, msg, true);
|
|
});
|
|
};
|