]> git.donarmstrong.com Git - infobot.git/blobdiff - src/UserExtra.pl
- moved scripts/setup_sql.pl to src/db_mysql as &createTables()
[infobot.git] / src / UserExtra.pl
index 2672304ae90728e9999c00bd476c881a96030fbe..2fd29f94b8f3664965929a1e86c266efb3e285eb 100644 (file)
@@ -152,10 +152,15 @@ sub chaninfo {
     my %new;
     foreach (keys %userstats) {
        next unless (exists $userstats{$_}{'Count'});
+       if ($userstats{$_}{'Count'} =~ /^\D+$/) {
+           &WARN("userstats{$_}{Count} is non-digit.");
+           next;
+       }
+
        $new{$_} = $userstats{$_}{'Count'};
     }
 
-    my($count) = (sort { $b <=> $a } keys %new)[0];
+    my($count) = (sort { $a <=> $b } keys %new)[0];
     if ($count) {
        $reply .= ".  \002$count\002 has said the most with a total of \002$new{$count}\002 messages";
     }