diff --git a/src/plugin/action/join.sjs b/src/plugin/action/join.sjs index c73953d..bf84fb0 100644 --- a/src/plugin/action/join.sjs +++ b/src/plugin/action/join.sjs @@ -11,7 +11,11 @@ module.exports = function (client, rawf, emitter) { reject(new Error("No channel given to join action.")); return; } - + var password; + if (typeof(channel) === "object") { + password = channel.password; + channel = channel.channel; + } const joinInfo = { names: [], channel: channel, @@ -104,10 +108,14 @@ module.exports = function (client, rawf, emitter) { }; client.debug("PluginAction", formatc("Attempting to join %s.")); - rawf("JOIN :%s", channel); + if (password !== undefined) { + rawf("JOIN %s :%s", channel, password); + } else { + rawf("JOIN :%s", channel); + } }) .tap(function (result) { emitter.emit("join", result); }); }; -}; \ No newline at end of file +};