2016-11-19 08:24:39 +00:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
exports.commands = ["away", "back"];
|
|
|
|
|
|
|
|
exports.input = function(network, chan, cmd, args) {
|
2016-12-18 09:24:50 +00:00
|
|
|
let reason = "";
|
2016-11-19 08:24:39 +00:00
|
|
|
|
2016-12-18 09:24:50 +00:00
|
|
|
if (cmd === "away") {
|
|
|
|
reason = args.length > 0 ? args.join(" ") : " ";
|
2016-11-19 08:24:39 +00:00
|
|
|
|
|
|
|
network.irc.raw("AWAY", reason);
|
2016-12-18 09:24:50 +00:00
|
|
|
} else { // back command
|
|
|
|
network.irc.raw("AWAY");
|
2016-11-19 08:24:39 +00:00
|
|
|
}
|
|
|
|
|
2016-12-18 09:24:50 +00:00
|
|
|
network.awayMessage = reason;
|
2017-04-28 15:58:14 +00:00
|
|
|
|
|
|
|
this.save();
|
2016-11-19 08:24:39 +00:00
|
|
|
};
|