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:
parent
a0d3b3271b
commit
efb53e397f
@ -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++;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user