问题
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