IRC-js
The best IRC library for node.js
Installation
Via command-line:
npm install irc-js
Via package.json
:
{ "dependencies":
{ "irc-js": "2" }
}
Tests
make test
2.0 Notes
We recently released the first beta of IRC-js 2.0.
This release brings many changes, and documentation is not quite ready.
IRC-js 2.0 uses a couple of new ECMAScript features, so currently you must use
the --harmony
flag when running it.
So, for the adventurous, here's how to get started with 2.0:
var irc = require("irc-js");
irc.connect({ nick: "bot500" }, function(bot) {
bot.join("#irc-js", function(err, chan) {
if (err) {
console.log("Could not join channel :(", err);
return;
}
chan.say("Hello!");
});
bot.match("INVITE", function(msg) {
msg.reply("Thanks for the invite! On my way.");
bot.join(msg.params[1]);
});
bot.match(/\bsomecommand\s+([a-z]+)\s+([0-9]+)/, function(msg, letters, digits) {
});
});