3
0
mirror of https://github.com/pragma-/pbot.git synced 2024-12-25 04:02:37 +01:00

Commands no longer case-sensitive

This commit is contained in:
Pragmatic Software 2017-08-03 13:30:18 -07:00
parent 2236a00877
commit 53ffb271b3

View File

@ -81,7 +81,7 @@ sub exists {
my ($keyword) = @_; my ($keyword) = @_;
foreach my $ref (@{ $self->{handlers} }) { foreach my $ref (@{ $self->{handlers} }) {
return 1 if $ref->{name} eq $keyword; return 1 if $ref->{name} eq lc $keyword;
} }
return 0; return 0;
} }
@ -97,6 +97,8 @@ sub interpreter {
my $level = defined $admin ? $admin->{level} : 0; my $level = defined $admin ? $admin->{level} : 0;
my $keyword = lc $keyword;
foreach my $ref (@{ $self->{handlers} }) { foreach my $ref (@{ $self->{handlers} }) {
if($ref->{name} eq $keyword) { if($ref->{name} eq $keyword) {
if($level >= $ref->{level}) { if($level >= $ref->{level}) {