From 55b8bd87c6f07d21de8b3037317b54c6a0374c86 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sun, 3 Jan 2016 11:37:51 -0500 Subject: Add irc-to-me method --- examples/bot.pl6 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'examples') 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 :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 -- cgit v1.1