Skip to content
This repository has been archived by the owner on Nov 30, 2020. It is now read-only.

add case insensitivity to commands #53

Merged
merged 2 commits into from Feb 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 3 additions & 1 deletion source/lion.py
Expand Up @@ -39,9 +39,11 @@ async def on_message(message):

return

command_match = re.match(COMMAND_PATTERN, message.content)
command_match = re.match(COMMAND_PATTERN, message.content, re.IGNORECASE)
if command_match is not None:
command = command_match.group("command")
message.content = message.content.replace(command, command.lower(), 1)
command = command.lower()

# If the command is supported, execute its function. Else call
# the "help" function.
Expand Down