projects
/
app-statsbot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
3cdbe25
)
Add !help command
author
Marius Gavrilescu
<marius@ieval.ro>
Sat, 24 Oct 2015 23:17:52 +0000
(
00:17
+0100)
committer
Marius Gavrilescu
<marius@ieval.ro>
Sat, 24 Oct 2015 23:17:52 +0000
(
00:17
+0100)
lib/App/Statsbot.pm
patch
|
blob
|
blame
|
history
diff --git
a/lib/App/Statsbot.pm
b/lib/App/Statsbot.pm
index 6403bee216e20c66937c8d83a37ba28c2fbc888f..d91020322efc2505ccf92ef89da5b6251fe8e842 100644
(file)
--- 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;
This page took
0.00996 seconds
and
4
git commands to generate.