Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you login with node-irc?

Tags:

node.js

irc

It is extremely easy to setup and it works fine. But nowhere in the documentation does it say how to

/msg nickserv identify <pword>

The closest I could find was

client.join('#yourchannel yourpass');

or maybe

For any commands that there aren’t methods for you can use the send() method which sends raw messages to the server
client.send('MODE', '#yourchannel', '+o', 'yournick');

but neither seems to get the job done.

like image 235
user1873073 Avatar asked Dec 21 '25 09:12

user1873073


2 Answers

client.say("nickserv", "identify <pword>"); doesn't work? The API says it should.

like image 198
hd1 Avatar answered Dec 23 '25 02:12

hd1


To expand answer above, the only way I found so far to really know when the client is fully connected, is using then autoConnect: false mode upon creation:

var client = new irc.Client('irc.freenode.net', 'CommandBot', {
  autoConnect: false
});
client.connect(retryCount, function(serverReply) {
  console.log("Connected!\n", serverReply);
  client.join('#channel', function(input) {
    console.log("Joined #channel");
    client.say('#channel', "Hi, madafaca");
  });
});
like image 25
tomyo Avatar answered Dec 23 '25 02:12

tomyo