From e56d58c07ccfe7d3e5ab9439d688259b70d60d95 Mon Sep 17 00:00:00 2001 From: David Phillips Date: Sat, 14 Jul 2018 19:34:37 +1200 Subject: Fix typo in module name --- Plugin/Titillate.pm | 37 +++++++++++++++++++++++++++++++++++++ Plugin/Tittilate.pm | 37 ------------------------------------- 2 files changed, 37 insertions(+), 37 deletions(-) create mode 100644 Plugin/Titillate.pm delete mode 100644 Plugin/Tittilate.pm (limited to 'Plugin') diff --git a/Plugin/Titillate.pm b/Plugin/Titillate.pm new file mode 100644 index 0000000..f969df7 --- /dev/null +++ b/Plugin/Titillate.pm @@ -0,0 +1,37 @@ +#!/usr/bin/env perl + +package Plugin::Titillate; + +use strict; +use warnings; + +my %config; + +sub configure { + my $self = $_[0]; + my $cmdref = $_[1]; + my $cref = $_[2]; + %config = %$cref; + return $self; +} + +sub message { + my ($self, $logger, $me, $who, $where, $raw_what, $what, $irc) = @_; + my $gathered = ""; + my @expressions = (keys %{$config{triggers}}); + my $expression = join '|', @expressions; + while ($what =~ /($expression)/gi) { + my $matched = $1; + my $key; + # figure out which key matched + foreach (@expressions) { + if ($matched =~ /$_/i) { + $key = $_; + last; + } + } + $gathered .= $config{triggers}->{$key}; + } + return $gathered; +} +1; diff --git a/Plugin/Tittilate.pm b/Plugin/Tittilate.pm deleted file mode 100644 index b2c2286..0000000 --- a/Plugin/Tittilate.pm +++ /dev/null @@ -1,37 +0,0 @@ -#!/usr/bin/env perl - -package Plugin::Tittilate; - -use strict; -use warnings; - -my %config; - -sub configure { - my $self = $_[0]; - my $cmdref = $_[1]; - my $cref = $_[2]; - %config = %$cref; - return $self; -} - -sub message { - my ($self, $logger, $me, $who, $where, $raw_what, $what, $irc) = @_; - my $gathered = ""; - my @expressions = (keys %{$config{triggers}}); - my $expression = join '|', @expressions; - while ($what =~ /($expression)/gi) { - my $matched = $1; - my $key; - # figure out which key matched - foreach (@expressions) { - if ($matched =~ /$_/i) { - $key = $_; - last; - } - } - $gathered .= $config{triggers}->{$key}; - } - return $gathered; -} -1; -- cgit v1.1