aboutsummaryrefslogtreecommitdiff
path: root/modules/sed.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-08-05 15:35:23 +0100
committerGravatar jesopo2018-08-05 15:35:23 +0100
commit7114bb7155497646e656ed29860b3bbe9e726690 (patch)
tree4891c2f639afbd69fbe59e42a8f8c8ba51a9d873 /modules/sed.py
parentImprove using correct nickname capitalisation in words.py (diff)
signature
only get "sed" setting when a message that looks like a sed command comes in
Diffstat (limited to 'modules/sed.py')
-rw-r--r--modules/sed.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/sed.py b/modules/sed.py
index 32934db5..ca75706c 100644
--- a/modules/sed.py
+++ b/modules/sed.py
@@ -21,10 +21,12 @@ class Module(object):
validate=Utils.bool_or_none)
def channel_message(self, event):
- if event["action"] or not Utils.get_closest_setting(event, "sed", True):
- return
sed_split = re.split(REGEX_SPLIT, event["message"], 3)
if event["message"].startswith("s/") and len(sed_split) > 2:
+ if event["action"] or not Utils.get_closest_setting(
+ event, "sed", True):
+ return
+
regex_flags = 0
flags = (sed_split[3:] or [""])[0]
count = None