mirror of
https://github.com/thelounge/thelounge
synced 2024-11-26 05:50:22 +00:00
dd05ee3a65
Co-authored-by: Eric Nemchik <eric@nemchik.com> Co-authored-by: Pavel Djundik <xPaw@users.noreply.github.com>
24 lines
412 B
TypeScript
24 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,
|
|
};
|