mirror of
https://github.com/thelounge/thelounge
synced 2024-11-10 22:54:15 +00:00
Merge pull request #745 from thelounge/xpaw/away-command
Implement /away and /back commands
This commit is contained in:
commit
3d0e1fd9f0
3 changed files with 23 additions and 0 deletions
|
@ -8,6 +8,8 @@ $(function() {
|
|||
reconnection: false
|
||||
});
|
||||
var commands = [
|
||||
"/away",
|
||||
"/back",
|
||||
"/close",
|
||||
"/connect",
|
||||
"/deop",
|
||||
|
@ -17,6 +19,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 a new issue