aboutsummaryrefslogtreecommitdiff
path: root/examples/bot.pl6
diff options
context:
space:
mode:
Diffstat (limited to 'examples/bot.pl6')
-rw-r--r--examples/bot.pl613
1 files changed, 11 insertions, 2 deletions
diff --git a/examples/bot.pl6 b/examples/bot.pl6
index 34528c7..524a74f 100644
--- a/examples/bot.pl6
+++ b/examples/bot.pl6
@@ -3,9 +3,18 @@ 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 )
-).run;
+ :plugins(
+ IRC::Client::Plugin::Debugger.new,
+ IRC::Client::Plugin::AddressedPlugin.new
+ )
+).run; \ No newline at end of file