Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
IRC bot written in node.js
JavaScript
tree: 719c49270b

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
data
lib
scripts
.gitignore
LICENSE.txt
README.md
config.js.sample
main.js

README.md

Nodebot - a node.js IRC bot

Prerequisites

  • node.js: v0.4.8 was used for development and testing of this bot.
  • request and jsdom: used by the googleweather.js lib which is used by the weather.js script, can be installed with npm install request and npm install jsdom
  • translate: used by the translate.js script, can be installed with npm install translate

Configuration

Copy config.js.sample to config.js and then look in the file for all configuration options. You can disable scripts by renaming them to a different extension or deleting/moving them out of the scripts folder.

Running

Just run node main.js. It will load the scripts and connect to the IRC server, at which time the scripts should react to messages on the server (e.g. autojoin.js will autojoin any channels, nickserv.js will identify with NickServ, pong.js will send a PONG reply to every PING).

It also starts a REPL loop, so that you can run commands manually. So for example, you could nodebot.join('#room') to cause the bot to join a room, nodebot.privmsg('#room', 'hi') to make the bot talk in the room, or nodebot.loadScripts() to reload the scripts. Refer to main.js for the available functions in the global.nodebot object, or run require('util').inspect(nodebot).

Scripts

Scripts are still under development, and the framework is such that one is not able to programmatically create a list of the available commands. Thus, the help.js script is rather useless and certainly not what one might expect. So please refer to the top and contents of each script to find out what it does. Each script has a comment at the top clearly explaining what the script does and each command it makes available.

For developing your own scripts, use the existing scripts as examples to make your own.

License

(c) 2011 Richard Carter

This project is licensed under the MIT license; see LICENSE.txt for details.

Something went wrong with that request. Please try again.