From 1d3037bd0029aa3316c5195c2be08cffc0d26344 Mon Sep 17 00:00:00 2001 From: Pavel Djundik Date: Mon, 4 Jul 2016 17:58:28 +0300 Subject: [PATCH] Register irc-framework events before connecting --- src/client.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/client.js b/src/client.js index a8bc3e8b..9a588efe 100644 --- a/src/client.js +++ b/src/client.js @@ -236,10 +236,20 @@ Client.prototype.connect = function(args) { } network.irc = new ircFramework.Client(); + network.irc.requestCap([ "echo-message", "znc.in/self-message", ]); + + events.forEach(function(plugin) { + var path = "./plugins/irc-events/" + plugin; + require(path).apply(client, [ + network.irc, + network + ]); + }); + network.irc.connect({ version: package.name + " " + package.version + " -- " + package.homepage, host: network.host, @@ -256,14 +266,6 @@ Client.prototype.connect = function(args) { auto_reconnect_max_retries: 360, // At least one hour (plus timeouts) worth of reconnections webirc: webirc, }); - - events.forEach(function(plugin) { - var path = "./plugins/irc-events/" + plugin; - require(path).apply(client, [ - network.irc, - network - ]); - }); }; Client.prototype.updateToken = function(callback) {