mirror of
https://github.com/thelounge/thelounge.git
synced 2024-06-28 10:10:20 +02:00
28 lines
478 B
JavaScript
28 lines
478 B
JavaScript
"use strict";
|
|
|
|
const Msg = require("../../models/msg");
|
|
|
|
module.exports = function (irc, network) {
|
|
const client = this;
|
|
|
|
irc.on("motd", function (data) {
|
|
const lobby = network.channels[0];
|
|
|
|
if (data.motd) {
|
|
const msg = new Msg({
|
|
type: Msg.Type.MOTD,
|
|
text: data.motd,
|
|
});
|
|
lobby.pushMessage(client, msg);
|
|
}
|
|
|
|
if (data.error) {
|
|
const msg = new Msg({
|
|
type: Msg.Type.MOTD,
|
|
text: data.error,
|
|
});
|
|
lobby.pushMessage(client, msg);
|
|
}
|
|
});
|
|
};
|