aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorZoffix Znet <cpan@zoffix.com>2016-01-03 11:37:51 -0500
committerZoffix Znet <cpan@zoffix.com>2016-01-03 11:37:51 -0500
commit55b8bd87c6f07d21de8b3037317b54c6a0374c86 (patch)
treed5a2ee2affd7470c6cd4facdb0522669380c77bb /examples
parenta35dad2b1a755cdff3f11a19472090dbd661d48c (diff)
Add irc-to-me method
Diffstat (limited to 'examples')
-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