From 047a79ead6b804d5b85bd91b5aada5c3ea3686d1 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Thu, 14 Apr 2016 11:56:02 +0300 Subject: [PATCH] Add separate /disconnect command --- src/client.js | 1 + src/plugins/inputs/disconnect.js | 7 +++++++ src/plugins/inputs/quit.js | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 src/plugins/inputs/disconnect.js diff --git a/src/client.js b/src/client.js index 194c09f9..98653ba7 100644 --- a/src/client.js +++ b/src/client.js @@ -36,6 +36,7 @@ var inputs = [ "part", "action", "connect", + "disconnect", "invite", "kick", "mode", diff --git a/src/plugins/inputs/disconnect.js b/src/plugins/inputs/disconnect.js new file mode 100644 index 00000000..a0ad99fb --- /dev/null +++ b/src/plugins/inputs/disconnect.js @@ -0,0 +1,7 @@ +exports.commands = ["disconnect"]; + +exports.input = function(network, chan, cmd, args) { + var quitMessage = args[0] ? args.join(" ") : ""; + + network.irc.quit(quitMessage); +}; diff --git a/src/plugins/inputs/quit.js b/src/plugins/inputs/quit.js index 7f54fccf..9039c704 100644 --- a/src/plugins/inputs/quit.js +++ b/src/plugins/inputs/quit.js @@ -1,6 +1,6 @@ var _ = require("lodash"); -exports.commands = ["quit", "disconnect"]; +exports.commands = ["quit"]; exports.allowDisconnected = true; exports.input = function(network, chan, cmd, args) {