]> git.donarmstrong.com Git - infobot.git/blobdiff - src/Modules/botmail.pl
agreed
[infobot.git] / src / Modules / botmail.pl
index 5bda41407a5815e7f2d4e738957f478747317452..c0ecab5e49e1b960bc6b9e60684ec45e0c168d53 100644 (file)
@@ -27,6 +27,9 @@ sub parse {
     if ($what =~ /^(for|add)\s+(.*)$/i) {
        &add( split(/\s+/, $2, 2) );
 
+    } elsif ($what =~ /^stats?$/i) {
+       &stats();
+
     } elsif ($what =~ /^check?$/i) {
        &check( $1, 1);
 
@@ -37,6 +40,11 @@ sub parse {
     }
 }
 
+sub stats {
+    my $botmail        = &::countKeys("botmail");
+    &::msg($::who, "I have \002$botmail\002 ". &::fixPlural("message", $botmail). ".");
+}
+
 #####
 # Usage: botmail::check($recipient, [$always])
 sub check {
@@ -52,7 +60,7 @@ sub check {
     if ($t == 0) {
        &::msg($recipient, "You have no botmail.") if ($always);
     } else {
-       &::msg($recipient, "You have $t messages awaiting, from: $from");
+       &::msg($recipient, "You have $t messages awaiting, from: $from (botmail read)");
     }
 }