Add comment about why we strip non-alnum chars from private commands

This commit is contained in:
jesopo 2019-05-23 16:10:31 +01:00
parent 4b5f839231
commit 61af81c9de

View file

@ -263,7 +263,11 @@ class Module(ModuleManager.BaseModule):
def private_message(self, event): def private_message(self, event):
if event["message_split"] and not event["action"]: if event["message_split"] and not event["action"]:
command = event["message_split"][0].lower() command = event["message_split"][0].lower()
# this should help catch commands when people try to do prefixed
# commands ('!help' rather than 'help') in PM
command = command.lstrip("".join(NON_ALPHANUMERIC)) command = command.lstrip("".join(NON_ALPHANUMERIC))
args_split = event["message_split"][1:] args_split = event["message_split"][1:]
hook, args_split = self._find_command_hook(event["server"], command, hook, args_split = self._find_command_hook(event["server"], command,