X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FApp%2FStatsbot.pm;h=902f9d336668bd930d7ad6bc87d8e4ef57ae9033;hb=d6102de2038794abd9388080c23d278632ef52e1;hp=449117068ab990221f4b1845563e78c361f999a1;hpb=6e23c401b100443891e08cae05b36a1e2b1c43ea;p=app-statsbot.git diff --git a/lib/App/Statsbot.pm b/lib/App/Statsbot.pm index 4491170..902f9d3 100644 --- a/lib/App/Statsbot.pm +++ b/lib/App/Statsbot.pm @@ -4,7 +4,7 @@ use 5.014000; use strict; use warnings; -our $VERSION = '0.001'; +our $VERSION = '0.001002'; use POE; use POE::Component::IRC::State; @@ -95,6 +95,8 @@ sub bot_start{ ## no critic (RequireArgUnpacking) $_[KERNEL]->delay(tick => $TICK); $irc->plugin_add(CTCP => POE::Component::IRC::Plugin::CTCP->new( + version => "Statsbot/$VERSION", + source => 'https://metacpan.org/pod/App::Statsbot', userinfo => 'A bot which keeps logs and computes channel statistics', clientinfo => 'PING VERSION CLIENTINFO USERINFO SOURCE', )); @@ -127,10 +129,10 @@ sub on_public{ my ($targets,$message)=@_[ARG1,ARG2]; my $botnick = _nick_name; - if ($message =~ /(?:$botnick[:,])?\s*!?help\s*(.*)/) { - _yield(privmsg => $targets, "Try !presence username interval [truncate]"); - _yield(privmsg => $targets, "For example, !presence mgv '2 days'"); - _yield(privmsg => $targets, "or !presence mgv '1 year' 4"); + if ($message =~ /(?:$botnick[:,])?\s*!?help\s*(.*)/sx) { + _yield(privmsg => $targets, 'Try !presence username interval [truncate]'); + _yield(privmsg => $targets, q/For example, !presence mgv '2 days'/); + _yield(privmsg => $targets, q/or !presence mgv '1 year' 4/); return; }