ZenIRCBot - Perl API for ZenIRCBot
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;
Perl API for ZenIRCBot.
See the ZenIRCBot documentation for more information.
Set callback for redis publish events.
The callback function is called on Redis subscribe events, with the message hashref and channel name.
ZenIRCBot
ZenIRCBot Documentation
Anthony Johnson <aj@ohess.org>
<aj@ohess.org>
To install ZenIRCBot, copy and paste the appropriate command in to your terminal.
cpanm
cpanm ZenIRCBot
CPAN shell
perl -MCPAN -e shell install ZenIRCBot
For more information on module installation, please visit the detailed CPAN module installation guide.