This project was a homework for our 'Linux Programming' course.
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.
Programs and papers
the IRC bot itself (
lpbot), ran by the administrator
the utility controller program (
lpbotctl), run by the users with sufficient privileges
lpbot has been written in C, using the following external libraries:
gcc installed, then you can build it using the
If you want to monitor the traffic of the bot, add
Now all you need is to customize
config.xml, the setting names are
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
identifycommand, it requires no more parameters in case using services, or requires one password parameter if configured to use password authentication
dbcommand, it has 3 subcommands:
db get titleto query an existing record,
db put title text hereto insert a new record or update an existing one and
db del titleto 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>)
connectcommand 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
remindcommand will send your password to your email address.
lpbotctlutility 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
pingcommand replies with a
pong, and the
eval <command>parameter is available for administrators to make the bot execute any IRC command.
The API documentation of the modules is available here.