only get "sed" setting when a message that looks like a sed command comes in
This commit is contained in:
parent
c2c60e309a
commit
7114bb7155
1 changed files with 4 additions and 2 deletions
|
@ -21,10 +21,12 @@ class Module(object):
|
||||||
validate=Utils.bool_or_none)
|
validate=Utils.bool_or_none)
|
||||||
|
|
||||||
def channel_message(self, event):
|
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)
|
sed_split = re.split(REGEX_SPLIT, event["message"], 3)
|
||||||
if event["message"].startswith("s/") and len(sed_split) > 2:
|
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
|
regex_flags = 0
|
||||||
flags = (sed_split[3:] or [""])[0]
|
flags = (sed_split[3:] or [""])[0]
|
||||||
count = None
|
count = None
|
||||||
|
|
Loading…
Reference in a new issue