gf3 / Jerk

Stupidly simple IRC bots in Javascript.
http://gf3.github.com/Jerk
The Unlicense
106 stars 17 forks source link

.connect() takes a long time to join channels #8

Closed walkah closed 13 years ago

walkah commented 13 years ago

hacking together a bot for some internal use and jerk(function() {}).connect(options) connects (to freenode) quickly, but takes a very long time to join the channels listed in options['channels'] - making it not that fun to hack on.

I'm not sure if this is an issue in jerk or irc-js...

gf3 commented 13 years ago

In order to function correctly on a wide variety of networks, Jerk, by default is set to join channels 15 seconds after it receives a PING from the server. This prevents the bot from trying to join channels too soon, then failing to join them at all. To cut down this time, you can change the timeout in the options to something shorter like so options.delayAfterConnect = 1.

Relevant Jerk code: https://github.com/gf3/Jerk/blob/master/lib/jerk.js#L32-42

gf3 commented 13 years ago

I should probably make this shorter by default though.

walkah commented 13 years ago

that's much better! thanks :-)