ajout de mon premier bot IRC, WooT

master
Philippe Pittoli 2012-08-24 04:04:34 +02:00
parent 2503200bcd
commit 02a605fde2
1 changed files with 20 additions and 0 deletions

20
perl/irc_bot.pl Executable file
View File

@ -0,0 +1,20 @@
#!/usr/bin/perl
use Modern::Perl;
use AnyEvent;
use AnyEvent::IRC::Client;
my $c = AnyEvent->condvar;
my $cl = AnyEvent::IRC::Client->new;
$cl->reg_cb (connect => sub {
my ($con, $err) = @_;
if (defined $err) {
warn "connect error: $err\n";
return;
}
});
$cl->connect ('irc.geeknode.org', 6667, { nick => '[bot]kanette' });
$cl->send_srv ( PRIVMSG => 'karchnu', 'Hi there!');
$c->wait;
$cl->disconnect;