Anthony Johnson > ZenIRCBot > ZenIRCBot

Download:
ZenIRCBot-0.01_01.tar.gz

Dependencies

Annotate this POD

Website

View/Report Bugs
Module Version: 0.01_01   Source  

NAME ^

ZenIRCBot - Perl API for ZenIRCBot

SYNOPSIS ^

  use ZenIRCBot;

  my $bot = ZenIRCBot->new();
  $bot->register_commands('ZenIRCBot::Test', [
      { name => 'foo', description => 'Returns bar' }
  ]);

  $bot->subscribe(sub {
      my ($msg, $channel) = @_;
      
      if ($msg->{version} == 1 and $msg->{type} eq 'privmsg') {
          if ($msg->{data}->{message} =~ m/foo/) {
              $bot->send_privmsg(
                  $msg->{data}->{channel},
                  sprintf("%s: bar", $msg->{data}->{sender})
              );
          }
      }
  });

  $bot->run;

DESCRIPTION ^

Perl API for ZenIRCBot.

METHODS ^

Standard API Methods

See the ZenIRCBot documentation for more information.

subscribe($func)

Set callback for redis publish events.

callback($message, $channel)

The callback function is called on Redis subscribe events, with the message hashref and channel name.

SEE ALSO ^

ZenIRCBot

ZenIRCBot Documentation

AUTHOR ^

Anthony Johnson <aj@ohess.org>

syntax highlighting: