Implement /away and /back commands
This commit is contained in:
parent
b7ff814d8b
commit
f24f707119
@ -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",
|
||||||
|
@ -39,6 +39,7 @@ var inputs = [
|
|||||||
"msg",
|
"msg",
|
||||||
"part",
|
"part",
|
||||||
"action",
|
"action",
|
||||||
|
"away",
|
||||||
"connect",
|
"connect",
|
||||||
"disconnect",
|
"disconnect",
|
||||||
"invite",
|
"invite",
|
||||||
|
19
src/plugins/inputs/away.js
Normal file
19
src/plugins/inputs/away.js
Normal 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");
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user