thelounge/src/plugins/irc-events/motd.js

28 lines
476 B
JavaScript
Raw Permalink Normal View History

"use strict";
const Msg = require("../../models/msg");
2014-09-13 23:29:45 +02:00
module.exports = function(irc, network) {
const client = this;
2014-09-13 23:29:45 +02:00
irc.on("motd", function(data) {
const lobby = network.channels[0];
if (data.motd) {
2018-02-13 12:05:49 +01:00
const msg = new Msg({
type: Msg.Type.MOTD,
text: data.motd,
});
2018-02-13 12:05:49 +01:00
lobby.pushMessage(client, msg);
}
if (data.error) {
const msg = new Msg({
2014-09-13 23:29:45 +02:00
type: Msg.Type.MOTD,
text: data.error,
2014-09-13 23:29:45 +02:00
});
lobby.pushMessage(client, msg);
}
2014-09-13 23:29:45 +02:00
});
};