An extendable IRC bot written in Node.js and CoffeeScript
Switch branches/tags
Nothing to show
Pull request Compare This branch is 37 commits behind mdwrigh2:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

An extensible IRC bot written in node.js


  • node-irc
  • mongoose


First make sure you have node.js and npm installed. Then use npm to install coffeescript and node-irc and mongoose. Now just copy to 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


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 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 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.

Event: 'command'

  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".

Event: 'message'

  function(from, to, message)

Emitted when a message is sent in one of the channels the bot is currently residing in.

Event: 'message#channel'

  function(from, message)

Emitted when a message is sent to the specified channel.

Event: 'motd'


Emitted when the connection to the IRC server is complete and the MOTD has been sent.

Event: 'names'

function(channel, nicks)

Event: 'topic'

function(channel, topic, nick)

Event: 'join'

function(channel, nick)

Event: 'join#channel'


Event: 'part'

function(channel, nick)

Event: 'part#channel'

function(nick, reason)

Event: 'quit'

function(nick, reason, channels)

Event: 'kick'

function(channel, nick, by, reason)

Event: 'kick#channel'


Event: 'notice'

function(nick, to, text)

Event: 'pm'

function(channel, nick)

Event: 'nick'

function(oldnick, newnick, channels)

Event: 'raw'


Event: 'error'