aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZoffix Znet <cpan@zoffix.com>2016-08-03 10:35:53 -0400
committerZoffix Znet <cpan@zoffix.com>2016-08-03 10:36:10 -0400
commit90904a99e74b04243151c2ee55afef66abf6a57e (patch)
treea16a1a48ac2c21f686578019ea2f6bb694c88770
parentf3b6fdb56f250a5d13c67f0816dc111973f23392 (diff)
Implement .match method on Privmsg/Notice objects
-rw-r--r--lib/IRC/Client/Message.pm64
1 files changed, 3 insertions, 1 deletions
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;