From: timriker Date: Sat, 23 Nov 2002 20:03:30 +0000 (+0000) Subject: agreed X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=b51df809e54e8154075d3b185e4d259444f50cf6;p=infobot.git agreed git-svn-id: https://svn.code.sf.net/p/infobot/code/trunk/blootbot@696 c11ca15a-4712-0410-83d8-924469b57eb5 --- diff --git a/src/Modules/botmail.pl b/src/Modules/botmail.pl index 690d49e..c0ecab5 100644 --- a/src/Modules/botmail.pl +++ b/src/Modules/botmail.pl @@ -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 { diff --git a/src/UserExtra.pl b/src/UserExtra.pl index bfd2487..d468fff 100644 --- a/src/UserExtra.pl +++ b/src/UserExtra.pl @@ -793,7 +793,6 @@ sub userCommands { my $startString = scalar(gmtime $^T); my $upString = &Time2String(time() - $^T); my $factoids = &countKeys("factoids"); - my $botmail = &countKeys("botmail"); $count{'Commands'} = 0; foreach (keys %cmdstats) { @@ -814,7 +813,6 @@ sub userCommands { &fixPlural("command",$count{'Commands'}). ". I have been awake for $upString this session, and ". "currently reference \002$factoids\002 factoids. ". - "I have \002$botmail\002 ". &fixPlural("message", $botmail). ". ". "I'm using about \002$memusage\002 ". "kB of memory." );