Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Add Plugin::Srugin

  • Loading branch information...
commit 65ff2d18f89f9ff7774dddac422aae83f4ec691b 1 parent 8755f8e
Tadeusz Sośnierz authored June 10, 2012

Showing 1 changed file with 19 additions and 0 deletions. Show diff stats Hide diff stats

  1. 19  a8bot/Plugin/Srugin.pm
19  a8bot/Plugin/Srugin.pm
... ...
@@ -0,0 +1,19 @@
  1
+package a8bot::Plugin::Srugin;
  2
+use feature ':5.10';
  3
+use Moose;
  4
+with 'a8bot::Plugin';
  5
+
  6
+sub BUILD {
  7
+    my $self = shift;
  8
+    $self->passive_cb(sub { pubmsg($self, @_) });
  9
+}
  10
+
  11
+sub pubmsg {
  12
+    my ($self, %data) = @_;
  13
+    if ($data{msg} =~ /\?(\S+)\?/) {
  14
+        my $prev = $1;
  15
+        my $new = $prev;
  16
+        $new =~ s/^[^aeiouy]*/sr/;
  17
+        return "$prev $new!";
  18
+    }
  19
+}

0 notes on commit 65ff2d1

Please sign in to comment.
Something went wrong with that request. Please try again.