aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/commands/__init__.py5
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,