2016-10-09 19:14:02 +00:00
|
|
|
"use strict";
|
|
|
|
|
2017-11-10 20:44:14 +00:00
|
|
|
const Msg = require("../../models/msg");
|
2014-09-13 21:29:45 +00:00
|
|
|
|
|
|
|
module.exports = function(irc, network) {
|
2017-11-10 20:44:14 +00:00
|
|
|
const client = this;
|
|
|
|
|
2014-09-13 21:29:45 +00:00
|
|
|
irc.on("motd", function(data) {
|
2017-11-10 20:44:14 +00:00
|
|
|
const lobby = network.channels[0];
|
2016-03-07 21:09:42 +00:00
|
|
|
|
|
|
|
if (data.motd) {
|
2018-02-13 11:05:49 +00:00
|
|
|
const msg = new Msg({
|
|
|
|
type: Msg.Type.MOTD,
|
|
|
|
text: data.motd,
|
2016-03-07 21:09:42 +00:00
|
|
|
});
|
2018-02-13 11:05:49 +00:00
|
|
|
lobby.pushMessage(client, msg);
|
2016-03-07 21:09:42 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (data.error) {
|
2017-11-10 20:44:14 +00:00
|
|
|
const msg = new Msg({
|
2014-09-13 21:29:45 +00:00
|
|
|
type: Msg.Type.MOTD,
|
2017-11-15 06:35:15 +00:00
|
|
|
text: data.error,
|
2014-09-13 21:29:45 +00:00
|
|
|
});
|
2016-04-19 10:20:18 +00:00
|
|
|
lobby.pushMessage(client, msg);
|
2016-03-07 21:09:42 +00:00
|
|
|
}
|
2014-09-13 21:29:45 +00:00
|
|
|
});
|
|
|
|
};
|