mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
ignore_case fix
This commit is contained in:
parent
fad45c66aa
commit
a049416b2d
1 changed files with 6 additions and 1 deletions
|
|
@ -164,7 +164,12 @@ class Command(Filter):
|
|||
result = allowed_command.match(command.command)
|
||||
if result:
|
||||
return replace(command, regexp_match=result)
|
||||
elif command.command == allowed_command: # String
|
||||
|
||||
command_name = command.command
|
||||
if self.ignore_case:
|
||||
command_name, allowed_command = map(str.casefold, (command_name, allowed_command))
|
||||
|
||||
if command_name == allowed_command: # String
|
||||
return command
|
||||
raise CommandException("Command did not match pattern")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue