Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Reply to thank-you's
  • Loading branch information
AlexDaniel committed Aug 22, 2019
1 parent 9d16c7c commit c1e3457
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
19 changes: 19 additions & 0 deletions lib/Whateverable.pm6
Expand Up @@ -106,6 +106,25 @@ multi method irc-to-me(Message $msg where .text ~~ /:i^ uptime \s* $/) {
~ implementing {.language_name} {.language_version}.
})
}
#| You're welcome!
sub you're-welcome is export {
«
You're welcome!
I'm happy to help!
Anytime!
It's my pleasure!
Thank you! You love me, you really love me!
\o/
»
}
#| Replying to thanks
multi method irc-to-me(Message $msg where .text ~~ /:i^ [‘thank you’|‘thanks’] \s* /) {
you're-welcome.pick
}
#| Replying to thanks
multi method irc-privmsg-channel($msg where .text ~~ /:i [‘thank you’|‘thanks’] .* $($msg.server.current-nick) /) {
you're-welcome.pick
}
#↓ Notices
multi method irc-notice-me( $ --> Nil) {} # Issue #321
#↓ Private messages
Expand Down
8 changes: 8 additions & 0 deletions xt/lib/Testable.pm6
Expand Up @@ -206,6 +206,14 @@ class Testable {
$.bot-nick,url,
$.our-nick, https://github.com/perl6/whateverable);

use Whateverable;
self.test(thank you (directly),
$.bot-nick: thank you!,
/^{$.our-nick}, ”@(you're-welcome)/);

self.test(thank you (indirectly),
thanks, $.bot-nick!,
/^{$.our-nick}, ”@(you're-welcome)/);

self.test(uptime,
{$.bot-nick}: uptime,
Expand Down

0 comments on commit c1e3457

Please sign in to comment.