From c56f8b4359f2730bb9e8bccd40bf2c9fa840f433 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sat, 4 Jun 2016 23:20:01 -0400 Subject: First working rewrite --- examples/bot.pl6 | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'examples') diff --git a/examples/bot.pl6 b/examples/bot.pl6 index 4fd1a26..70dbaa3 100644 --- a/examples/bot.pl6 +++ b/examples/bot.pl6 @@ -1,11 +1,19 @@ -use v6; use lib 'lib'; use IRC::Client; +use IRC::Client::Plugin; + +class MyPlug does IRC::Client::Plugin { + method irc-privmsg-channel ($msg) { + return $.IRC_NOT_HANDLED unless $msg.text ~~ /^'say' \s+ $=(.+)/; + $msg.reply: "How about: $.uc()"; + } +} my $irc = IRC::Client.new( :nick('IRCBot' ~ now.Int) - :debug - :channels<#zofbot> - :host - #:port<5667> + :debug<1> + # :channels<#zofbot> + # :host + :port<5667> + :plugins(MyPlug.new) ).run; -- cgit v1.1