twiedenbein-thelounge
Version:
The self-hosted Web IRC client
30 lines (29 loc) • 1.01 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const msg_1 = __importDefault(require("../../models/msg"));
const msg_2 = require("../../../shared/types/msg");
exports.default = (function (irc, network) {
const client = this;
irc.on("motd", function (data) {
const lobby = network.getLobby();
if (data.motd) {
const msg = new msg_1.default({
type: msg_2.MessageType.MONOSPACE_BLOCK,
command: "motd",
text: data.motd,
});
lobby.pushMessage(client, msg);
}
if (data.error) {
const msg = new msg_1.default({
type: msg_2.MessageType.MONOSPACE_BLOCK,
command: "motd",
text: data.error,
});
lobby.pushMessage(client, msg);
}
});
});