From 0daa494480f7abe37a6e593c6238811009b7b914 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Fri, 3 Jun 2016 07:01:14 -0400 Subject: Start rewrite --- examples/bot.pl6 | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'examples') diff --git a/examples/bot.pl6 b/examples/bot.pl6 index 524a74f..3737de1 100644 --- a/examples/bot.pl6 +++ b/examples/bot.pl6 @@ -1,20 +1,8 @@ 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"; - } -} my $irc = IRC::Client.new( - :host - :channels<#perl6bot #zofbot> :debug - :plugins( - IRC::Client::Plugin::Debugger.new, - IRC::Client::Plugin::AddressedPlugin.new - ) -).run; \ No newline at end of file + :port<5667> +).run; -- cgit v1.1 From cb0a6cace8871d17c9701edc1ccba26d1e6e0bfe Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sat, 4 Jun 2016 10:32:49 -0400 Subject: Wtf --- 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 3737de1..94eb929 100644 --- a/examples/bot.pl6 +++ b/examples/bot.pl6 @@ -1,8 +1,16 @@ use v6; use lib 'lib'; -use IRC::Client; +use IRC::Client::Grammar; +use IRC::Client::Grammar:Actions; -my $irc = IRC::Client.new( - :debug - :port<5667> -).run; +say IRC::Client::Grammar.parse( + 'PRIVMSG #perl6 :hello', + actions => IRC::Client::Grammar::Actions.new, +).made; + +# use IRC::Client; +# +# my $irc = IRC::Client.new( +# :debug +# :port<5667> +# ).run; -- cgit v1.1 From 791d7981cff0cd3a85fdd504f410a7c9833272dc Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sat, 4 Jun 2016 15:16:43 -0400 Subject: More stuff --- examples/bot.pl6 | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) (limited to 'examples') diff --git a/examples/bot.pl6 b/examples/bot.pl6 index 94eb929..255a0f4 100644 --- a/examples/bot.pl6 +++ b/examples/bot.pl6 @@ -1,16 +1,9 @@ use v6; use lib 'lib'; -use IRC::Client::Grammar; -use IRC::Client::Grammar:Actions; +use IRC::Client; -say IRC::Client::Grammar.parse( - 'PRIVMSG #perl6 :hello', - actions => IRC::Client::Grammar::Actions.new, -).made; - -# use IRC::Client; -# -# my $irc = IRC::Client.new( -# :debug -# :port<5667> -# ).run; +my $irc = IRC::Client.new( + :nick('IRCBot' ~ now.Int) + :debug + :port<5667> +).run; -- cgit v1.1 From 5a2196b2c8f2ac2eacb3ddaf40b3e75b9c38bb62 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sat, 4 Jun 2016 19:18:31 -0400 Subject: Stuff --- examples/bot.pl6 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/bot.pl6 b/examples/bot.pl6 index 255a0f4..4fd1a26 100644 --- a/examples/bot.pl6 +++ b/examples/bot.pl6 @@ -5,5 +5,7 @@ use IRC::Client; my $irc = IRC::Client.new( :nick('IRCBot' ~ now.Int) :debug - :port<5667> + :channels<#zofbot> + :host + #:port<5667> ).run; -- cgit v1.1 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 From c194b1d8b3b4e85d5ffd5b36c7deb63a494386fa Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sun, 5 Jun 2016 09:04:21 -0400 Subject: Z --- examples/bot.pl6 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/bot.pl6 b/examples/bot.pl6 index 70dbaa3..d64e9b8 100644 --- a/examples/bot.pl6 +++ b/examples/bot.pl6 @@ -14,6 +14,9 @@ my $irc = IRC::Client.new( :debug<1> # :channels<#zofbot> # :host - :port<5667> + :servers( + inspircd => { :port<6667> } + mine => { :port<5667> } + ) :plugins(MyPlug.new) ).run; -- cgit v1.1 From 6f3f00300a122e33ca1050fdb42cccda39fe9ba4 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sun, 5 Jun 2016 10:14:38 -0400 Subject: Z --- examples/bot.pl6 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/bot.pl6 b/examples/bot.pl6 index d64e9b8..12245db 100644 --- a/examples/bot.pl6 +++ b/examples/bot.pl6 @@ -15,8 +15,8 @@ my $irc = IRC::Client.new( # :channels<#zofbot> # :host :servers( - inspircd => { :port<6667> } - mine => { :port<5667> } + mine => { :port<5667> }, + inspircd => { :port<6667> }, ) :plugins(MyPlug.new) ).run; -- cgit v1.1 From 140959e4f170d732d990e69b9a0ca129b89e3ac4 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sun, 5 Jun 2016 21:39:47 -0400 Subject: First working test --- examples/bot.pl6 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/bot.pl6 b/examples/bot.pl6 index 12245db..3a2127e 100644 --- a/examples/bot.pl6 +++ b/examples/bot.pl6 @@ -14,9 +14,11 @@ my $irc = IRC::Client.new( :debug<1> # :channels<#zofbot> # :host + :port<6667> :servers( mine => { :port<5667> }, - inspircd => { :port<6667> }, + inspircd => { }, + # freenode => { :host }, ) :plugins(MyPlug.new) ).run; -- cgit v1.1 From 505933841a1384c234be7b05739c4713b0ee4022 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Fri, 10 Jun 2016 06:39:52 -0400 Subject: Intermediary --- examples/bot.pl6 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/bot.pl6 b/examples/bot.pl6 index 3a2127e..7d76630 100644 --- a/examples/bot.pl6 +++ b/examples/bot.pl6 @@ -12,12 +12,13 @@ class MyPlug does IRC::Client::Plugin { my $irc = IRC::Client.new( :nick('IRCBot' ~ now.Int) :debug<1> - # :channels<#zofbot> + :channels<#perl6 #perl7> # :host :port<6667> :servers( mine => { :port<5667> }, - inspircd => { }, + + # inspircd => { }, # freenode => { :host }, ) :plugins(MyPlug.new) -- cgit v1.1 From c341e8432ef33b5a598e6b9d3a75855f02104b6c Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Tue, 19 Jul 2016 13:16:16 -0400 Subject: Blahg --- examples/bot.pl6 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'examples') diff --git a/examples/bot.pl6 b/examples/bot.pl6 index 7d76630..47b7149 100644 --- a/examples/bot.pl6 +++ b/examples/bot.pl6 @@ -15,11 +15,11 @@ my $irc = IRC::Client.new( :channels<#perl6 #perl7> # :host :port<6667> - :servers( - mine => { :port<5667> }, + # :servers( + # mine => { :port<5667> }, # inspircd => { }, # freenode => { :host }, - ) + # ) :plugins(MyPlug.new) ).run; -- cgit v1.1 From 18615cc9bb33801fbde2716513071e7b32af2ab2 Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Sun, 24 Jul 2016 16:20:12 -0400 Subject: moar work --- examples/bot.pl6 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'examples') 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+ $=(.+)/; + method irc-privmsg-channel ($msg where .text ~~ /^'say' \s+ $=(.+)/ ) { $msg.reply: "How about: $.uc()"; } } my $irc = IRC::Client.new( - :nick('IRCBot' ~ now.Int) - :debug<1> + :nick('IRCBot') + :debug<2> :channels<#perl6 #perl7> # :host :port<6667> -- cgit v1.1