martynsmith / node-irc

NodeJS IRC client library
GNU General Public License v3.0
1.33k stars 424 forks source link

I can connect to channels only on connect #536

Open enriquemorenotent opened 5 years ago

enriquemorenotent commented 5 years ago

If I connect and set automatically join channels:

let client = new irc.Client("someserver", "somenick", { channels: ["#somechannel"]})

...it works great, but if I do this:

let client = new irc.Client("someserver", "somenick", {})
client.join("#somechannel")

I get the following error:

"Error: {"prefix":"verne.freenode.net","server":"verne.freenode.net","command":"err_notregistered","rawCommand":"451","commandType":"error","args":["*","You have not registered"]}

What is different on both operations?

Booster2ooo commented 4 years ago

As the errror states (err_notregistered), you need to wait for the registered event before joining the channel(s).