1. Status

This project was a homework for our Linux Programming course.

2. Specification

2.1. Functions

My aim is to create an IRC bot, with the following minimal features:

  • automatic parallel connections to multiple servers, and to multiple channels within a server, automatic reconnect on network errors

  • authentication of users (with password and/or using services available on the network)

  • implementation of a simple wiki-like database, users with sufficient privileges can create records (storing creation and modification time for each record, storing old versions as well)

  • controlling the bot via a tcp port: users with sufficient privileges can connect to the bot using a utility program and can control it to execute given commands (for example connect to a new server if the bot is not connected to any server)

  • other extra nice features: RSS reader (announces the link of new entries to a given channel), sending forgotten password via e-mail.

2.2. Programs and papers

  • the IRC bot itself (lpbot), ran by the administrator

  • the utility controller program (lpbotctl), run by the users with sufficient privileges

  • administrator guide

  • user guide

  • developer guide

3. Administrator guide

lpbot has been written in C, using the following external libraries:

You need make and gcc installed, then you can build it using the

$ make

command.

If you want to monitor the traffic of the bot, add -DDEBUG to CFLAGS in Makefile.

Now all you need is to customize config.xml, the setting names are pretty self-explaining.

4. User guide

The following features are available for a user:

  • automatic parallel connect to multiple servers

  • automatic join to multiple channels, if the connect was successful

  • automatic reconnect on network error (ping timeout, read/write error)

  • commands are available via the public channel (via highlight) or in a private query as well

  • identify command, it requires no more parameters in case using services, or requires one password parameter if configured to use password authentication

  • db command, it has 3 subcommands: db get title to query an existing record, db put title text here to insert a new record or update an existing one and db del title to delete a record.

  • the bot binds to port 1100 and you can access the commands via telnet as well (the syntax is <login> PRIVMSG lpbot <command>)

  • connect command to connect to a new server: connect test localhost 6667 lpbot2 #lpbot_local

  • you can configure rss feeds in the config and the bot announces the new entries on the configured channels from time to time (interval can be set via the rss_interval option).

  • the remind command will send your password to your email address.

  • the lpbotctl utility can be used to control the bot once it is disconnected from all servers. usage: lpbotctl [user] [host] [port]. it defaults to the current system user name, localhost and 1100, respectively.

  • there are few commands in addition to the ones which were described in the specification: the ping command replies with a pong, and the eval <command> parameter is available for administrators to make the bot execute any IRC command.

5. Developer guide

The API documentation of the modules is available here.

6. Download

From github.