From eb794ab080a8858d61077751c0b6763abd8991b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9mie=20Astori?= Date: Sat, 20 Feb 2016 05:21:21 +0000 Subject: [PATCH] Add a simplified way to invite a user in the current channel --- src/plugins/inputs/invite.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/plugins/inputs/invite.js b/src/plugins/inputs/invite.js index 769edd0a..e87d320a 100644 --- a/src/plugins/inputs/invite.js +++ b/src/plugins/inputs/invite.js @@ -2,8 +2,12 @@ module.exports = function(network, chan, cmd, args) { if (cmd !== "invite") { return; } + var irc = network.irc; + if (args.length === 2) { - irc.invite(args[0], args[1]); + irc.invite(args[0], args[1]); // Channel provided in the command + } else if (args.length === 1 && chan.type === "channel") { + irc.invite(args[0], chan.name); // Current channel } };