My irc bot shall have the possibility to do things at a certain time. Users need to be able to set (show and delete) alarms and get spoken to at the desired time.

Working with Bot::BasicBot::Pluggable I had the idea of using alarms of a POE::Kernel session. Should I go with that idea or is there a simpler/better way to achieve my goal?

When calling run() on the BasicBot object, I don't get the POE object back in any way, to start another session (at least, I didn't see a way). Could you point me into the right direction? How can I start two POE sessions, where one of them is the BasicBot which handles the irc conversations and the other session just takes care about alarms?

Thanks for your help!

This is how the bot is started:
#!/usr/bin/perl use Modern::Perl; use Bot::BasicBot::Pluggable; my $bot = Bot::BasicBot::Pluggable->new( channels => ["#bottest"], server => "irc.test.test", port => "6667", nick => "bot", ); $bot->load('MyModule'); $bot->run();

...and the module where the bot reacts to things said/done in irc looks like this (excerpt):

package Bot::BasicBot::Pluggable::Module::MyModule; use warnings; use strict; use base qw(Bot::BasicBot::Pluggable::Module); sub init { my $self = shift; $self->config( { sc => 2 } ); } sub help { return "Does wild things"; } sub admin { my ($self, $msg) = @_; my $who = $msg->{who}; my $body = $msg->{body}; my $channel = $msg->{channel}; my $address = $msg->{address}; # if($address) { # return "you talk to me"; # } # ... } 1;

In reply to schedule alarms with POE and Bot::BasicBot::Pluggable ? by brengo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.