#!perl5

use Bot::BasicBot:from<Perl5>;

class P6Bot is Bot::BasicBot {
   method can($method) {
       return 1;
   }

   method said(%statement) {
       self.reply(
           $%statement,  
           "Hullo {%statement<who>}!"
       ) if %statement<body> eq 'Hi bot!';

       self.shutdown('leaving...')  
           if %statement<body> eq 'bot quit';
   }
}

my $bot = P6Bot.new(
   server   => "irc.freenode.org",
   port     => "6667",
   channels => ["#perl6bot"],
   nick     => "p6basicbot",
   name     => "Yet Another Bot",
);

$bot.run();

# vim: ft=perl6
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
~                                                                                                                                                                                                                         
                                                                                                                                                                                                      31,1          All