cronic: an IRC bot to do time related things

ivorw on 2006-06-12T14:05:03

Inspired by a future need for the Cogers Society to do online debating, I decided to have a go at writing an IRC bot. This was my first attempt.

I decided on Bot::BasicBot as a start point - I had heard good things about this module. I picked Time::Piece and Parse::RecDescent as two modules to use that I am already familiar with.

I found when developing this that lanching the bot gave two warnings about calls to new() being deprecated in POE::Component::IRC. I happened to be in correspondence with the module's author later, and prodded jerakeen (author of Bot::BasicBot) via RT. The outcome is that Bot::BasicBot has now been brought up to date and everyone's happy.

The idea is to give cronic fairly simple commands, such as:

cronic: at 12:30 say It's lunch time
cronic: after 5:00 say Your five minutes are up

The bot will ignore any text on the channel for which it has not been directly addressed. The bot will also respond to PRIVMSG, allowing personal reminders.

There's still plenty of things for me to do:

  • Implement time zones; migrate to DateTime. Work in progress. This has involved me grokking DateTime and associated modules.

  • Documentation. I need to put up a webpage somewhere with "how to use this bot".

  • Persistent events in a database. These could include perl monger meeting reminders and people's birthdays.

  • More commands than just "say". It would be useful for cronic to switch the topic, for example.

The bot is up and running on #bots for those who want to have a play. I'll try and catch any scrollback, but if you want, you can email bug reports to cronic at xemaps.com.


incomplete channel spec

merlyn on 2006-06-12T16:11:14

"The bot is up and running on #bots"

That's an incomplete spec. There are many IRC nets, and they don't talk to each other. You need to include the network name when you mention a channel.

Yeah, it's probably clear to you and to the three people you know that might most be interested, but it's completely opaque to the casual reader.

Re:incomplete channel spec

TeeJay on 2006-06-12T17:31:39

irc.perl.org is kind of implied by this being use.perl.org and the bot being written in perl

Obviously if it was some obscure IRC Network that would be different.

Re:incomplete channel spec

merlyn on 2006-06-13T13:12:39

Again, you may think that to be obvious, but there are far more people on EFnet #perl than on irc.perl.org, and Freenode #perl comes in fairly large as well.

Gotta get out every once in a while. :)