IRC-Bot
view release on metacpan or search on metacpan
irc_mode => "on_mode",
irc_kick => "on_kick",
irc_notice => "on_notice",
irc_ctcp_ping => "on_ping",
irc_ctcp_version => "on_ver",
irc_ctcp_finger => "on_finger",
irc_ctcp_page => "on_page",
irc_ctcp_time => "on_time",
irc_ctcp_action => "on_action",
irc_nick => "on_nick",
keepalive => "keepalive",
irc_433 => "on_nick_taken",
irc_353 => "on_names",
irc_dcc_request => "on_dcc_req",
irc_dcc_error => "on_dcc_err",
irc_dcc_done => "on_dcc_done",
irc_dcc_start => "on_dcc_start",
irc_dcc_chat => "on_dcc_chat",
}
]
my ( $self, $kernel, $channel, $msg ) = @_;
$kernel->post( NICK, 'privmsg', $channel, $msg );
}
# Borrowed this code from another bot
# Can't for the life of me remember which one
# Please, let me know if it was you, so I can
# give props!!
sub keepalive {
my ( $self, $kernel, $heap ) = @_[ OBJECT, KERNEL, HEAP ];
$heap->{'keepalive_time'} += 180;
$kernel->alarm( 'keepalive' => $heap->{'keepalive_time'} );
$kernel->post( NICK, 'sl', 'PING ' . time() );
}
# Handle public events
sub on_public {
my ( $self, $kernel, $who, $where, $msg ) =
@_[ OBJECT, KERNEL, ARG0 .. $#_ ];
my $nick = ( split /!/, $who )[0];
( run in 1.031 second using v1.01-cache-2.11-cpan-39bf76dae61 )