Saturday, July 28, 2007

Announcing python-jabberbot

I've just released the first version of python-jabberbot, a simple framework to easily write Jabber bots in Python. The framework utilizes the wonderful xmpppy library for the XMPP protocol and was inspired by the xmpppy library bot.py example, although my implementation is targeted at users wanting to simply implement some bot functionality in Python without much hassle.

To implement a bot with python-jabberbot, simply subclass the provided JabberBot class and add some methods to your class that start with "bot_", i.e. "bot_status". The method will receive three parameters: The "self" object, a "mess" object that is the message being received by the client and an "args" object which is a string and contains the parameters given to the jabber bot.

A basic example that returns some system information can be found on the website and a more advanced example showing how to do multi-threading and message broadcasting can be found here. This one has been Aanice afternoon time killer - I hope this is useful to somebody someday :)

No comments: