3 # version 0.1, michael scherer, misc@zarb.org
5 # stevan little <stevan@iinteractive.com>
7 # the first perl6 irc bot ( or at least, what i hope to be the first ).
9 say "A irc perl 6 bot";
11 my $nick = @
*ARGS
[0] // "didie_p6";
12 my $server = "irc.freenode.net";
16 my $hdl = connect($server, 6667);
20 $hdl.say("NICK $nick\nUSER $nick $nick $nick $nick\n");
23 # first line is not so important, it can be discarded ( or i hope )
26 $hdl.say("JOIN $chan\n");
31 while $ligne = $hdl.get
{
32 say "Serveur said : $ligne"; # if $debug;
38 $hdl.say("PONG $nick\n");
43 && rx
:P5
/^\:(.*?)\!.*?\sPRIVMSG $chan/ {
46 when rx
:P5
/\b(?i:hello|hi)\b/ {
47 $hdl.say("PRIVMSG $chan :Hello $writer from a perl 6 irc bot\n");