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