hardlounge/server/plugins/inputs/away.ts
Max Leiter dd05ee3a65
TypeScript and Vue 3 (#4559)
Co-authored-by: Eric Nemchik <eric@nemchik.com>
Co-authored-by: Pavel Djundik <xPaw@users.noreply.github.com>
2022-06-18 17:25:21 -07:00

25 lines
412 B
TypeScript

const commands = ["away", "back"];
import {PluginInputHandler} from "./index";
const input: PluginInputHandler = function (network, chan, cmd, args) {
let reason = "";
if (cmd === "away") {
reason = args.join(" ") || " ";
network.irc.raw("AWAY", reason);
} else {
// back command
network.irc.raw("AWAY");
}
network.awayMessage = reason;
this.save();
};
export default {
commands,
input,
};