Merge pull request #745 from thelounge/xpaw/away-command
Implement /away and /back commands
This commit is contained in:
commit
3d0e1fd9f0
@ -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",
|
||||||
|
@ -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