An extensible IRC bot written in node.js
First make sure you have node.js and npm installed. Then use npm to install coffeescript and node-irc and mongoose. Now just copy example-config.coffee to config.coffee and replace the config options with their appropriate values. Note that some of the plugins may be irc server dependent (mostly freenode). See the documentation for each plugin in order to determine which will work on what network if you aren't sure.
npm install -g coffee-script npm install -g irc npm install -g mongoose --mongodb:native # Be sure NODE_PATH is set if you use -g as suggested above. The correct NODE_PATH can be found using: npm root -g coffee vertexbot.coffee
Plugins are fairly simple to develop, just write the plugin and drop it into the 'plugins/' folder. Plugins should export a list of objects under the events variable, and each object should have an action member that contains a string for what event to react to, and a reaction member function that contains what to do when that event occurs. See the log.coffee plugin for an example. If your plugin is more complex than something you want to put in a single file, place it in a directory and create a front end *script file for the bot to include. If you want the functionality to be available to many plugins, such as the database plugin, place it in the utils folder. Other plugins can require it from there. Again, see the log.coffee plugin for an example of something using a shared utility.
This is a list of the events emitted by the bot. Note that most of the commands are actually emitted from node-irc, so see there for further documentation on events.
function(from, to, command, args)
Emitted when a command is issued to the bot. Commands are anything where the bot is directly told something, and the args is just a string with everything after the command issued. For example, the message "bot: do something awesome" would have the command "do" and the args "something awesome".
function(from, to, message)
Emitted when a message is sent in one of the channels the bot is currently residing in.
Emitted when a message is sent to the specified channel.
Emitted when the connection to the IRC server is complete and the MOTD has been sent.
function(channel, topic, nick)
function(nick, reason, channels)
function(channel, nick, by, reason)
function(nick, to, text)
function(oldnick, newnick, channels)