3
0
mirror of https://github.com/pragma-/pbot.git synced 2025-01-23 10:34:52 +01:00

count now does whole-word matching

This commit is contained in:
Pragmatic Software 2017-11-17 21:36:41 -08:00
parent a0d3b3271b
commit efb53e397f

View File

@ -1077,7 +1077,7 @@ sub count {
my $i = 0;
my $total = 0;
if(not defined $arguments) {
if (not length $arguments) {
return "Usage: count <nick|factoids>";
}
@ -1088,7 +1088,7 @@ sub count {
foreach my $command (keys %{ $factoids->{$channel} }) {
next if $factoids->{$channel}->{$command}->{type} ne 'text';
$total++;
if($factoids->{$channel}->{$command}->{owner} =~ /\Q$arguments\E/i) {
if($factoids->{$channel}->{$command}->{owner} =~ /^\Q$arguments\E$/i) {
$i++;
}
}