aboutsummaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorZoffix Znet <zoffixznet@users.noreply.github.com>2016-07-26 08:50:02 -0400
committerGitHub <noreply@github.com>2016-07-26 08:50:02 -0400
commite0478c07e2096d85e20764c08c83a3d16c002e94 (patch)
tree592510005886adaadb49848d289c5c712279ecee /examples
parente997c1b0b5ad796425abfc9f81b91947357172ce (diff)
parentcc19189ff6b74bea5211d521a59dbff0c71a0749 (diff)
Merge Rewrite 2.0 version into master
Old version should not be used anymore and 2.0 is ready to go, sans some bugs
Diffstat (limited to 'examples')
-rw-r--r--examples/bot.pl629
1 files changed, 16 insertions, 13 deletions
diff --git a/examples/bot.pl6 b/examples/bot.pl6
index 524a74f..e991a8e 100644
--- a/examples/bot.pl6
+++ b/examples/bot.pl6
@@ -1,20 +1,23 @@
-use v6;
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";
+class MyPlug does IRC::Client::Plugin {
+ method irc-privmsg-channel ($msg where .text ~~ /^'say' \s+ $<cmd>=(.+)/ ) {
+ $msg.reply: "How about: $<cmd>.uc()";
}
}
my $irc = IRC::Client.new(
- :host<localhost>
- :channels<#perl6bot #zofbot>
- :debug
- :plugins(
- IRC::Client::Plugin::Debugger.new,
- IRC::Client::Plugin::AddressedPlugin.new
- )
-).run; \ No newline at end of file
+ :nick('IRCBot')
+ :debug<2>
+ :channels<#perl6 #perl7>
+ # :host<irc.freenode.net>
+ :port<6667>
+ # :servers(
+ # mine => { :port<5667> },
+
+ # inspircd => { },
+ # freenode => { :host<irc.freenode.net> },
+ # )
+ :plugins(MyPlug.new)
+).run;