Permalink
Browse files

Add Plugin::Srugin

  • Loading branch information...
1 parent 8755f8e commit 65ff2d18f89f9ff7774dddac422aae83f4ec691b @tadzik committed Jun 10, 2012
Showing with 19 additions and 0 deletions.
  1. +19 −0 a8bot/Plugin/Srugin.pm
View
@@ -0,0 +1,19 @@
+package a8bot::Plugin::Srugin;
+use feature ':5.10';
+use Moose;
+with 'a8bot::Plugin';
+
+sub BUILD {
+ my $self = shift;
+ $self->passive_cb(sub { pubmsg($self, @_) });
+}
+
+sub pubmsg {
+ my ($self, %data) = @_;
+ if ($data{msg} =~ /\?(\S+)\?/) {
+ my $prev = $1;
+ my $new = $prev;
+ $new =~ s/^[^aeiouy]*/sr/;
+ return "$prev $new!";
+ }
+}

0 comments on commit 65ff2d1

Please sign in to comment.