thelounge/src/plugins/inputs/notice.js
2016-04-07 16:07:37 -04:00

26 lines
487 B
JavaScript

exports.commands = ["notice"];
exports.input = function(network, chan, cmd, args) {
if (!args[1]) {
return;
}
var message = args.slice(1).join(" ");
var irc = network.irc;
irc.notice(args[0], message);
var targetChan = network.getChannel(args[0]);
if (typeof targetChan === "undefined") {
message = "{to " + args[0] + "} " + message;
targetChan = chan;
}
irc.emit("notice", {
nick: irc.user.nick,
target: targetChan.name,
message: message
});
return true;
};