Hive13 / jIRCBot

The Hive13 Chat Bot
http://wiki.hive13.org/Hive13_IRC_Bot
5 stars 2 forks source link

Hive13 IRC Bot

Wikipage: http://wiki.hive13.org/Hive13_IRC_Bot

This is the bot that hanges out in irc.freenode.net #hive13. The bot is written in Java with a MySQL database for logging messages and a PHP website for displaying said log.

Building

Easiest way to build is using ant, the root of the project has an ant buildfile.xml which will generate a runnable jar file.

The bot is developed using eclipse, and if the repository is retrieved at the root it contains all libraries (other than the JDK) needed to build the bot. I have tried to extensively comment the code to make everyone's lives easier. If you have already retrieved the project using Git, you can open it in Eclipse by going to File->Import->General->Existing Projects Into Workspace, then selecting the projects root directory.

Project Structure

Code Structure

This is all horribly out of date. We recently migrated to using PircBotX 1.9. This is the successor to the jibble PircBot framework.

Old comments below

The project is organized into two top level package trees, org.hive13.jircbot and org.jibble.pircbot. We are primarily interested in org.hive13.jircbot.

org.jibble.pircbot

The code for jIRCBot is an extension of the PIRCBot which provides the basic IRC bot framework that I have extended. I have made some very minor changes to PIRCBot which is why its code is part of the project.

org.hive13.jircbot

The main 'bot' code which starts the bot and directly inherits from the PircBot code is the jIRCBot.java class. I sorta look at this class as the air traffic controller of the bot. Requests come in from the wild world of the IRC chat room and this class directs them to sub-classes which handle these messages.

commands

These classes are what I consider the 'plugins' of the bot. jIB = java IRC Bot, not my most inspired chose for a prefix, I know. At this point all of the commands are run asynchronously from the bot's primary thread. There are two primary classes that all of the commands inherit from, jIBCommand and jIBCommandThread

support

Pretty much what the name implies these are the classes which provide some helper functions to the rest of the bot. These classes manage the properties and common tasks.

Making a small, small change to trigger a build.