Index ¦ Archives ¦ Atom

Purple IRC Bot

Updated March 19th with additional feature information. Updated July 29th to describe where the p! commands can be used. Updated January 5th to indicate change in p! handling and the addition of [l <nid>].

Back in December I wrote Persistent IRC Considered Harmful. In there I complained about the way IRC is used in the OpenStack environment. One of the issues is that IRC has become the center of information exchange and existing logging solutions don't really work very well for keeping up. I've started exploring some ideas that might help.

All of this is very much experimental and under development so the examples below may fail or behave differently.

Besides basic logging, the first feature I wanted was a URI for every message in every channel being logged. This enables some useful features:

  • Refer to a line of text by its URL but have it displayed in context: http://p.anticdent.org/6NG
  • When in a channel where the bot is present a line of text can be retrieved and displayed by transcluding it: [t 6NG]
  • If transclusion is not desired a link can be retrieved instead: [l 6NG]

Both of these are based on the granular addressability ideas from Purple Numbers as they were implemented in the Purple Universe.

Making those things work required a persistent store. Once there's a store and a bot, more features fall out:

  • Web features:
  • Bot features:
    • p!help: Get this list of commands.
    • p!logs: Get a private message containing a link to the list of logs.
    • p!log: Get a private message containing a link to the log for the current channel.
    • p!hist [count]: Get a private message of up to ten recent messages.
    • p!spy [count]: Get a private message of up to ten recent mentions of your nick.

Set count to limit the result to at most count results.

The p!… commands can be used in a channel, where the channel context will be implied, or in a private message to the bot, where the channel needs to be named: /msg purplerbot p!spy openstack-nova 5. When using a private message the p! prefix is not required; thus, for example, /msg purplerbot help will work.

The code is on Github. What's there provides the basic logging bot and a web service to present the logs. However, the database is designed to be able support giving granular purple numbers to any kind of content and either storing copies of the content or references to its original location. With that it should be possible transclude between a variety of systems, eventually.

© Chris Dent. Built using Pelican. Theme by Giulio Fidente on github.