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

class IRC::Client::Plugin::AddressedPlugin is IRC::Client::Plugin {
    method irc-addressed ($irc, $e, $where) {
        $irc.privmsg: $where[0], "$where[1], you addressed me";
    }
}

my $irc = IRC::Client.new(
    :host<localhost>
    :channels<#perl6bot #zofbot>
    :debug
    :plugins(
        IRC::Client::Plugin::Debugger.new,
        IRC::Client::Plugin::AddressedPlugin.new
    )
).run;