more tests

This commit is contained in:
Klemek
2021-04-08 23:50:33 +02:00
parent 990853110b
commit b60b5916f8
2 changed files with 172 additions and 14 deletions
+5 -4
View File
@@ -193,7 +193,7 @@ class Bot(object):
message.content = re.sub(r"<@!?[^>]+>", "", message.content)
elif is_mention:
message.content = re.sub(
f"^<@!?{self.client.user.id}>", "", message.content
f"<@!?{self.client.user.id}>", "", message.content, count=1
)
command_args = parse_arguments(message.content)
@@ -212,12 +212,13 @@ class Bot(object):
command_found = False
if self.lower_command_names:
command_args[0] = command_args[0].lower()
for command in self.__commands:
if re.match(
command.regex,
command_args[0].lower()
if self.lower_command_names
else command_args[0],
command_args[0],
):
if self.log_calls:
debug(message, str(command_args))