X-Git-Url: http://git.ieval.ro/?a=blobdiff_plain;f=lib%2FApp%2FStatsbot.pm;h=8e03642918d06901de6d112590b651a6ea766b8a;hb=fbde5e292211baf3b5b288d5077918cbaa6e5d6b;hp=fcc79594eefc2656742758b52de94af9b3957aa3;hpb=01dcdb6958f188e5aa30f44f06989e4f0cac8e41;p=app-statsbot.git diff --git a/lib/App/Statsbot.pm b/lib/App/Statsbot.pm index fcc7959..8e03642 100644 --- a/lib/App/Statsbot.pm +++ b/lib/App/Statsbot.pm @@ -138,14 +138,14 @@ sub on_public{ my ($targets,$message)=@_[ARG1,ARG2]; my $botnick = _nick_name; - if ($message =~ /(?:$botnick[:,])?\s*!?help\s*(.*)/sx) { + if ($message =~ /^(?:$botnick[:,]\s*!?|\s*!)help/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; } - return unless $message =~ /(?:$botnick[:,])?\s*!?presence\s*(.*)/sx; + return unless $message =~ /^(?:$botnick[:,])?\s*!?presence\s*(.*)/sx; my ($nick, $time, $truncate) = shellwords $1; $truncate//=-1;