From 53ffb271b345d5ab776fe03e9cfd966abeab86fe Mon Sep 17 00:00:00 2001 From: Pragmatic Software Date: Thu, 3 Aug 2017 13:30:18 -0700 Subject: [PATCH] Commands no longer case-sensitive --- PBot/Commands.pm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/PBot/Commands.pm b/PBot/Commands.pm index 2049384b..9b6ec5d1 100644 --- a/PBot/Commands.pm +++ b/PBot/Commands.pm @@ -81,7 +81,7 @@ sub exists { my ($keyword) = @_; foreach my $ref (@{ $self->{handlers} }) { - return 1 if $ref->{name} eq $keyword; + return 1 if $ref->{name} eq lc $keyword; } return 0; } @@ -97,6 +97,8 @@ sub interpreter { my $level = defined $admin ? $admin->{level} : 0; + my $keyword = lc $keyword; + foreach my $ref (@{ $self->{handlers} }) { if($ref->{name} eq $keyword) { if($level >= $ref->{level}) {