]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/botmail.pl
botmail check working now
[infobot.git] / src / Modules / botmail.pl
index b34869535f9266c35863a6443fdfa51b8c68029e..95acc7e3656817cecf9030402f5bdbc95210c341 100644 (file)
@@ -19,8 +19,11 @@ sub parse {
        return;
     }
 
-    if ($what =~ /^add\s+(.*)$/i) {
-       &add( split(/\s+/, $1, 2) );
+    if ($what =~ /^(add|for)\s+(.*)$/i) {
+       &add( split(/\s+/, $2, 2) );
+
+    } elsif ($what =~ /^check(\s+(.*))?$/i) {
+       &check( split(/\s+/, $1, 2) );
 
     } elsif ($what =~ /^next$/i) {
        # todo: read specific items? nah, will make this too complex.
@@ -33,6 +36,7 @@ sub parse {
 # Usage: botmail::check($recipient)
 sub check {
     my($recipient) = @_;
+    $recipient ||= $::who;
 
     # todo: simplify this select (use a diff function)
     my @from = &::dbGet("botmail", "srcwho",