diff options
-rw-r--r-- | Plugin/Men.pm | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/Plugin/Men.pm b/Plugin/Men.pm new file mode 100644 index 0000000..1e8d71a --- /dev/null +++ b/Plugin/Men.pm @@ -0,0 +1,39 @@ +package Plugin::Men; + +use strict; +use warnings; + +my $config; +my $root_config; + +sub configure { + my $self = shift; + shift; # cmdref + shift; # run_command + shift; # module config + $root_config = shift; + + return $self; +} + +sub on_message { + my ($self, $logger, $me, $who, $where, $raw_what, $what, $irc) = @_; + + if (ref($where) eq "ARRAY") { + $where = $where->[0]; + } + + if ($what =~ /(\b.+men.+\b)/) { + my ($w, $c, $target); + $w = $c = $target = $1; + $w =~ s/men/women/; + $c =~ s/men/children/; + return "not just the $target, but the $w and $c too"; + } + return; +} + +sub on_action { + on_message(@_); +} +1; |