aboutsummaryrefslogtreecommitdiff
path: root/Plugin/Men.pm
diff options
context:
space:
mode:
authorDavid Phillips <david@yeah.nah.nz>2018-11-16 14:51:42 +1300
committerDavid Phillips <david@yeah.nah.nz>2018-11-16 14:51:42 +1300
commit5906aa48ea29ad02c05ec63bd2cf6789b187b901 (patch)
tree6fc2c1468e1e6d3667d75751a5878f54f21d92c9 /Plugin/Men.pm
parentc071cf47e93d9156ea522893be4e4e88cb7e30f3 (diff)
downloadidalius-5906aa48ea29ad02c05ec63bd2cf6789b187b901.tar.xz
Add Men->women/children plugin
Diffstat (limited to 'Plugin/Men.pm')
-rw-r--r--Plugin/Men.pm39
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;