My first Supybot plugin

Using the guide I linked to the other day, I was able to create my first Supybot plugin tonight. It was far easier than I had expected.

Including a ’supybot-plugin-create’ script was a really nice touch on the part of the developers. The script asked me a few questions and then generated the basic skeleton of a working plugin:

europa $ supybot-plugin-create What should the name of the plugin be? DemoPlugin Sometimes you'll want a callback to be threaded. If its methods (command or regexp-based, either one) will take a significant amount of time to run, you'll want to thread them so they don't block the entire bot. Does your plugin need to be threaded? [y/n] y What is your real name, so I can fill in the copyright and license appropriately? J. Mulligan Do you wish to use Supybot's license for your plugin? [y/n] y Your new plugin template is in the DemoPlugin directory.

After that, all that I really had to do was walk through the guide, add some docstrings, and write the functions for the commands I wanted to add.

The plugin I wrote is just a simple dice-roller that accepts dice/modifier combinations such as 2d6+1, but it really wouldn’t be any harder to write something much more complex. I’m really impressed with the Supybot plugin system. Very cool.

Leave a Reply