#!/usr/bin/perl -w
#
# Copyright 2005, Karl Y. Pradene <knotty@cpan.org> All rights reserved.
#
# Dumb Bot for test Net::IRC2

use Net::IRC2;

use strict; 
use warnings;
$| = 1;
sub p($) { print "@_\n" }


my $bot = new Net::IRC2;

my $conn = $bot->newconn(uri=>'irc://B1-66ER!void@irc.geeknode.org:6667/') || die 'No Connection';
$conn->mode($conn->nick,'+B');
my $sock = $conn->socket;

#$bot->callback(\&process_event);
$bot->add_handler(['002','003'], \&dump_event);
$bot->add_handler(['376'],\&end_of_motd);
$bot->start;

sub dump_event { 
    $_[0]->dump;
}
sub end_of_motd {
#    $conn->join('#Bot');
}
sub Net::IRC2::Connection::cb001{ $_[0]->dump }
exit 0;


