use utils.deadline in sed.py

This commit is contained in:
jesopo 2019-08-30 17:17:31 +01:00
parent e97e3c8f30
commit 162aab9851

View file

@ -54,8 +54,11 @@ class Module(ModuleManager.BaseModule):
for_user = event["user"].nickname if self._closest_setting(event,
"sed-sender-only", False) else None
match = event["target"].buffer.find(pattern, from_self=False,
for_user=for_user, not_pattern=REGEX_SED)
def _find():
return event["target"].buffer.find(pattern, from_self=False,
for_user=for_user, not_pattern=REGEX_SED)
match = utils.deadline(_find)
if match:
new_message = re.sub(pattern, replace, match.line.message,
count)