2016-10-09 19:14:02 +00:00
|
|
|
"use strict";
|
|
|
|
|
2016-03-14 04:21:42 +00:00
|
|
|
exports.commands = ["notice"];
|
|
|
|
|
|
|
|
exports.input = function(network, chan, cmd, args) {
|
|
|
|
if (!args[1]) {
|
2014-09-13 21:29:45 +00:00
|
|
|
return;
|
|
|
|
}
|
2016-01-17 21:18:43 +00:00
|
|
|
|
2018-01-11 11:33:36 +00:00
|
|
|
let targetChan = network.getChannel(args[0]);
|
|
|
|
let message = args.slice(1).join(" ");
|
|
|
|
|
|
|
|
network.irc.notice(args[0], message);
|
2016-01-17 21:18:43 +00:00
|
|
|
|
|
|
|
if (typeof targetChan === "undefined") {
|
|
|
|
message = "{to " + args[0] + "} " + message;
|
|
|
|
targetChan = chan;
|
|
|
|
}
|
|
|
|
|
2016-04-22 16:38:13 +00:00
|
|
|
if (!network.irc.network.cap.isEnabled("echo-message")) {
|
2018-01-11 11:33:36 +00:00
|
|
|
network.irc.emit("notice", {
|
|
|
|
nick: network.irc.user.nick,
|
2016-04-22 16:38:13 +00:00
|
|
|
target: targetChan.name,
|
2017-11-15 06:35:15 +00:00
|
|
|
message: message,
|
2016-04-22 16:38:13 +00:00
|
|
|
});
|
|
|
|
}
|
2016-03-06 09:24:56 +00:00
|
|
|
|
|
|
|
return true;
|
2014-09-13 21:29:45 +00:00
|
|
|
};
|