diff options
| author | 2019-05-23 16:03:49 +0100 | |
|---|---|---|
| committer | 2019-05-23 16:03:49 +0100 | |
| commit | 0a23e71e4e4a631255403a1ae201ff03b7b15f53 (patch) | |
| tree | 7fa6405b1c75fa537c525b250eba367886d3d07f /modules | |
| parent | Remove `self` param of _validate (diff) | |
| signature | ||
.lstrip alphanumeric chars from private commands
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/commands/__init__.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/commands/__init__.py b/modules/commands/__init__.py index 140ebc35..1cc3e63a 100644 --- a/modules/commands/__init__.py +++ b/modules/commands/__init__.py @@ -1,4 +1,4 @@ -import re +import re, string from src import EventManager, ModuleManager, utils from . import outs @@ -9,6 +9,8 @@ REGEX_ARG_NUMBER = re.compile(r"\$(\d+)(-?)") MSGID_TAG = utils.irc.MessageTag("msgid", "draft/msgid") +NON_ALPHANUMERIC = [char for char in string.printable if char.isalnum()] + def _command_method_validate(s): if s.upper() in COMMAND_METHODS: return s.upper() @@ -261,6 +263,7 @@ class Module(ModuleManager.BaseModule): def private_message(self, event): if event["message_split"] and not event["action"]: command = event["message_split"][0].lower() + command = command.lstrip("".join(NON_ALPHANUMERIC)) args_split = event["message_split"][1:] hook, args_split = self._find_command_hook(event["server"], command, |
