Implement /away and /back commands

This commit is contained in:
Pavel Djundik 2016-11-19 10:24:39 +02:00
parent b7ff814d8b
commit f24f707119
3 changed files with 23 additions and 0 deletions

View File

@ -6,6 +6,8 @@ $(function() {
var path = window.location.pathname + "socket.io/"; var path = window.location.pathname + "socket.io/";
var socket = io({path: path}); var socket = io({path: path});
var commands = [ var commands = [
"/away",
"/back",
"/close", "/close",
"/connect", "/connect",
"/deop", "/deop",
@ -15,6 +17,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");
};