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

28 lines
478 B
JavaScript
Raw Normal View History

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