only get "sed" setting when a message that looks like a sed command comes in

This commit is contained in:
jesopo 2018-08-05 15:35:23 +01:00
parent c2c60e309a
commit 7114bb7155

View file

@ -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