hardlounge/server/plugins/inputs/away.ts

25 lines
412 B
TypeScript
Raw Permalink Normal View History

const commands = ["away", "back"];
import {PluginInputHandler} from "./index";
2016-11-19 08:24:39 +00:00
const input: PluginInputHandler = function (network, chan, cmd, args) {
let reason = "";
2016-11-19 08:24:39 +00:00
if (cmd === "away") {
2018-06-07 16:23:51 +00:00
reason = args.join(" ") || " ";
2016-11-19 08:24:39 +00:00
network.irc.raw("AWAY", reason);
2019-07-17 09:33:59 +00:00
} else {
// back command
network.irc.raw("AWAY");
2016-11-19 08:24:39 +00:00
}
network.awayMessage = reason;
this.save();
2016-11-19 08:24:39 +00:00
};
export default {
commands,
input,
};