dd05ee3a65
Co-authored-by: Eric Nemchik <eric@nemchik.com> Co-authored-by: Pavel Djundik <xPaw@users.noreply.github.com>
25 lines
412 B
TypeScript
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,
|
|
};
|