Reformat list of greetings
[poe-component-irc-plugin-hello.git] / lib / POE / Component / IRC / Plugin / Hello.pm
index a5770aa0350d03020f2ef22cc2871cde4ae3be60..eb83848eebcdce6b60367b1605f6292c002fc43d 100644 (file)
@@ -3,7 +3,7 @@ package POE::Component::IRC::Plugin::Hello;
 use 5.014000;
 use strict;
 use warnings;
-our $VERSION = '0.001001';
+our $VERSION = '0.001002';
 
 use List::Util qw/first/;
 
@@ -13,7 +13,13 @@ use POE::Component::IRC::Plugin qw/PCI_EAT_NONE/;
 sub new {
        my $class = shift;
        my $self = {
-               greetings => [qw/privet hello salut salutari neata neaţa hola hey hi bonjour wassup sup hallo chikmaa tungjatjeta parev salam namaskaar mingalarba ahoy saluton allo moin aloha namaste shalom ciào ciao servus salve ave merhaba witaj hei hola selam sawubona/, "what's up", 'que tal', 'こんにちは', '你好', 'ni hao'],
+               greetings => [
+                       qw/privet hello salut salutari neata neaţa neața neatza
+                          hola hey hi bonjour wassup sup hallo chikmaa
+                          tungjatjeta parev salam namaskaar mingalarba ahoy
+                          saluton allo moin aloha namaste shalom ciào ciao servus
+                          salve ave merhaba witaj hei hola selam sawubona/,
+                       "what's up", 'que tal', 'こんにちは', '你好', 'ni hao'],
                @_
        };
 
@@ -34,7 +40,7 @@ sub S_public{
        my $mynick = $irc->nick_name;
        my @hello = @{$self->{greetings}};
 
-       my $match = first { $$rmessage =~ /^\s*(?:$mynick(?:)[:,])?\s*$_\s*$/i } @hello;
+       my $match = first { $$rmessage =~ /^\s*(?:$mynick(?:)[:,])?\s*$_\s*[.!]?\s*$/i } @hello;
        $irc->yield(privmsg => $$rchannels->[0] => $hello[int rand $#hello].", $nick") if $match;
        PCI_EAT_NONE
 }
This page took 0.010123 seconds and 4 git commands to generate.