thelounge/server/plugins/irc-events/sasl.ts
Reto Brunner 3eb19135f5 wip: msg
2024-04-21 15:10:41 +02:00

30 lines
704 B
TypeScript

import {IrcEventHandler} from "../../client";
import Msg from "../../models/msg";
import {MessageType} from "../../../shared/types/msg";
export default <IrcEventHandler>function (irc, network) {
const client = this;
irc.on("loggedin", (data) => {
const lobby = network.getLobby();
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.getLobby();
const msg = new Msg({
type: MessageType.LOGOUT,
text: "Logged out",
});
lobby.pushMessage(client, msg, true);
});
};