diff --git a/perl/irc_bot.pl b/perl/irc_bot.pl
index 5335a05..d28acb9 100755
--- a/perl/irc_bot.pl
+++ b/perl/irc_bot.pl
@@ -6,6 +6,8 @@ use AnyEvent::IRC::Client;
 
 my $c = AnyEvent->condvar;
 my $cl = AnyEvent::IRC::Client->new;
+my $timer;
+
 $cl->reg_cb (connect => sub {
 		my ($con, $err) = @_;
 		if (defined $err) {
@@ -13,8 +15,31 @@ $cl->reg_cb (connect => sub {
 			return;
 		}
 	});
+
+$cl->reg_cb (registered => sub { say "I'm in!"; });
+$cl->reg_cb (disconnect => sub { say "I'm out!";  $c->broadcast });
+
+$cl->reg_cb (
+	sent => sub {
+		my ($con) = @_;
+
+		if ($_[2] eq 'PRIVMSG') {
+			print "Sent message!\n";
+
+			$timer = AnyEvent->timer (
+				after => 1,
+				cb => sub {
+					undef $timer;
+					say "on est dans cb";
+					$con->disconnect ('done')
+				}
+			);
+		}
+	}
+);
+
 $cl->connect ('irc.geeknode.org', 6667, { nick => '[bot]kanette' });
-$cl->send_srv ( PRIVMSG => 'karchnu', 'Hi there!');
+$cl->send_srv ( PRIVMSG => 'karchnu', 'Bot enabled : woot');
 $c->wait;
 
 $cl->disconnect;