aboutsummaryrefslogtreecommitdiff
path: root/examples/bot.pl6
blob: e991a8eb5b493d1b0d59ca00f1430587c128a5f1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
use lib 'lib';
use IRC::Client;

class MyPlug does IRC::Client::Plugin {
    method irc-privmsg-channel ($msg where .text ~~ /^'say' \s+ $<cmd>=(.+)/ ) {
        $msg.reply: "How about: $<cmd>.uc()";
    }
}

my $irc = IRC::Client.new(
    :nick('IRCBot')
    :debug<2>
    :channels<#perl6 #perl7>
    # :host<irc.freenode.net>
    :port<6667>
    # :servers(
        # mine     => { :port<5667> },

        # inspircd => {             },
        # freenode => { :host<irc.freenode.net> },
    # )
    :plugins(MyPlug.new)
).run;