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

View File

@ -39,6 +39,7 @@ var inputs = [
"msg", "msg",
"part", "part",
"action", "action",
"away",
"connect", "connect",
"disconnect", "disconnect",
"invite", "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");
};