Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

ivorw (5222)

  (email not shown publicly)

Journal of ivorw (5222)

Monday June 12, 2006
09:05 AM

cronic: an IRC bot to do time related things

[ #29880 ]

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

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • "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.

    • Randal L. Schwartz
    • Stonehenge
    • is kind of implied by this being and the bot being written in perl

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

      @JAPH = qw(Hacker Perl Another Just);
      print reverse @JAPH;
      • Again, you may think that to be obvious, but there are far more people on EFnet #perl than on, and Freenode #perl comes in fairly large as well.

        Gotta get out every once in a while. :)

        • Randal L. Schwartz
        • Stonehenge