hardlounge/src/plugins/inputs/away.js
2017-04-28 18:58:14 +03:00

20 lines
341 B
JavaScript

"use strict";
exports.commands = ["away", "back"];
exports.input = function(network, chan, cmd, args) {
let reason = "";
if (cmd === "away") {
reason = args.length > 0 ? args.join(" ") : " ";
network.irc.raw("AWAY", reason);
} else { // back command
network.irc.raw("AWAY");
}
network.awayMessage = reason;
this.save();
};