Merge pull request #745 from thelounge/xpaw/away-command

Implement /away and /back commands
This commit is contained in:
Jérémie Astori 2016-12-16 23:16:02 -05:00 committed by GitHub
commit 3d0e1fd9f0
3 changed files with 23 additions and 0 deletions

View file

@ -8,6 +8,8 @@ $(function() {
reconnection: false
});
var commands = [
"/away",
"/back",
"/close",
"/connect",
"/deop",
@ -17,6 +19,7 @@ $(function() {
"/join",
"/kick",
"/leave",
"/me",
"/mode",
"/msg",
"/nick",

View file

@ -39,6 +39,7 @@ var inputs = [
"msg",
"part",
"action",
"away",
"connect",
"disconnect",
"invite",

View file

@ -0,0 +1,19 @@
"use strict";
exports.commands = ["away", "back"];
exports.input = function(network, chan, cmd, args) {
if (cmd === "away") {
let reason = " ";
if (args.length > 0) {
reason = args.join(" ");
}
network.irc.raw("AWAY", reason);
return;
}
network.irc.raw("AWAY");
};