Simple Irc Bots for Nodejs
CoffeeScript
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples
lib
src
Cakefile
README.md
package.json

README.md

#BotJs

##Install npm install botjs

##Description

botjs is a Simple module for writing irc bots in NodeJs.

botjs uses a plugin based system for interacting with the Irc connection.

Each plugin defined in the bots plugins array must be an Object which contains a property called matcher and a method called callback which will be evaluated when theres a match on the matcher property.

Matcher is a String containing a Regexp to be matched over the current line read in from the Irc Connection.

A plugins callback method should contain two parameters. The first being the instance of the bot itself. The second is an Object containing information about the current line being matched against.

###Example Plugins ####CoffeeScript sayHey = {} sayHey.matcher = "!hey" sayHey.callback = (bot, irc) -> bot.msg irc.chan, "well hey there #{irc.user}"

exports.sayHey = sayHey

####JavaScript var sayHey = {}; sayHey.matcher = '!hey'; sayHey.callback = function(bot, irc) { bot.msg(irc.chan, "well hey there " + irc.user); };

exports.sayHey = sayHey;