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 socket = io({path: path});
|
||||
var commands = [
|
||||
"/away",
|
||||
"/back",
|
||||
"/close",
|
||||
"/connect",
|
||||
"/deop",
|
||||
@ -15,6 +17,7 @@ $(function() {
|
||||
"/join",
|
||||
"/kick",
|
||||
"/leave",
|
||||
"/me",
|
||||
"/mode",
|
||||
"/msg",
|
||||
"/nick",
|
||||
|
@ -39,6 +39,7 @@ var inputs = [
|
||||
"msg",
|
||||
"part",
|
||||
"action",
|
||||
"away",
|
||||
"connect",
|
||||
"disconnect",
|
||||
"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