Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Perl API to ZenIRCBot
Perl
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
t
.gitignore
Changes
MANIFEST
MANIFEST.SKIP
Makefile.PL
README.textile

README.textile

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 <ajohess.org>@

Something went wrong with that request. Please try again.