How do you login with node-irc?

一世执手 提交于 2019-12-23 20:13:10

问题


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.


回答1:


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




回答2:


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");
  });
});


来源:https://stackoverflow.com/questions/14596110/how-do-you-login-with-node-irc

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!