Python IRCBot module(last modified: 26 December, '06)

A high level interface to the IRC network

ircbot.py provides you with a very simple framework with which to write your bots. If you want to really program your own bot, or just want something super lightweight with which to do simple things (e.g controlling a webserver, etc) instead of writing plugins for supybot, then this could be just right for you. Written a couple of years ago, but it seems to work as good as ever :-). A full example of a bot that responds when someone says 'hello' in a channel it resides in would be as follows:

1import ircbot
2class HelloBot(ircbot.IRCBot):
3def messageFromChannel(self, channel, user, message):
4if message.startswith("hello"):
5self.sendMessageToChannel(channel, "Hello to you too " + user + "!")
6
7bot = HelloBot("HelloBot", "irc.freenode.net", ["#hellobot"])
8bot.execute()
9bot.close()

It's all commented with epytext docstrings (seemed like a good idea at a time, heh) so you can generate some documentation for it using epydoc.
Marvin icon by Everaldo.