aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/bot.pl68
1 files changed, 3 insertions, 5 deletions
diff --git a/examples/bot.pl6 b/examples/bot.pl6
index 47b7149..e991a8e 100644
--- a/examples/bot.pl6
+++ b/examples/bot.pl6
@@ -1,17 +1,15 @@
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+ $<cmd>=(.+)/;
+ method irc-privmsg-channel ($msg where .text ~~ /^'say' \s+ $<cmd>=(.+)/ ) {
$msg.reply: "How about: $<cmd>.uc()";
}
}
my $irc = IRC::Client.new(
- :nick('IRCBot' ~ now.Int)
- :debug<1>
+ :nick('IRCBot')
+ :debug<2>
:channels<#perl6 #perl7>
# :host<irc.freenode.net>
:port<6667>