X-Git-Url: http://git.ieval.ro/?p=app-statsbot.git;a=blobdiff_plain;f=lib%2FApp%2FStatsbot.pm;fp=lib%2FApp%2FStatsbot.pm;h=d91020322efc2505ccf92ef89da5b6251fe8e842;hp=6403bee216e20c66937c8d83a37ba28c2fbc888f;hb=410c016e029d80a8a8ce28b04e89a5160b8ebda1;hpb=3cdbe25624e004e048af74ae3840af2d5a698e33 diff --git a/lib/App/Statsbot.pm b/lib/App/Statsbot.pm index 6403bee..d910203 100644 --- a/lib/App/Statsbot.pm +++ b/lib/App/Statsbot.pm @@ -110,6 +110,14 @@ sub on_fatal{ die "Fatal error: $_[ARG0]" } sub on_public{ my ($targets,$message)=@_[ARG1,ARG2]; my $botnick = $irc->nick_name; + + if ($message =~ /(?:$botnick[:,])?\s*!?help\s*(.*)/) { + $irc->yield("Try !presence username interval [truncate]"); + $irc->yield("For example, !presence mgv '2 days'"); + $irc->yield("or !presence mgv '1 year' 4"); + return; + } + return unless $message =~ /(?:$botnick[:,])?\s*!?presence\s*(.*)/; my ($nick, $time, $truncate) = shellwords $1;