From 90904a99e74b04243151c2ee55afef66abf6a57e Mon Sep 17 00:00:00 2001 From: Zoffix Znet Date: Wed, 3 Aug 2016 10:35:53 -0400 Subject: Implement .match method on Privmsg/Notice objects --- lib/IRC/Client/Message.pm6 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/IRC/Client/Message.pm6 b/lib/IRC/Client/Message.pm6 index bb1a40b..79ef7d8 100644 --- a/lib/IRC/Client/Message.pm6 +++ b/lib/IRC/Client/Message.pm6 @@ -34,7 +34,8 @@ role Ping does M { role Privmsg does M { has $.text is rw; has Bool $.replied is rw = False; - method Str { $.text } + method Str { $.text } + method match ($v) { $.text ~~ $v } } role Privmsg::Channel does Privmsg { has $.channel; @@ -54,6 +55,7 @@ role Notice does M { has $.text is rw; has Bool $.replied is rw = False; method Str { $.text } + method match ($v) { $.text ~~ $v } } role Notice::Channel does Notice { has $.channel; -- cgit v1.1