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