diff options
| author | 2017-10-27 13:15:33 +0100 | |
|---|---|---|
| committer | 2017-10-27 13:15:33 +0100 | |
| commit | 0df7abb03e2a75744a575bc9a7b349fa98d6f485 (patch) | |
| tree | f6a4a5f952f030108371588347a45f0cea684eed /modules/sed.py | |
| parent | Amber Rudd (diff) | |
| signature | ||
Handle empty CAP, additional IRCLog feature, better tls, better channel_save logic, add sed-sender-only setting
Signed-off-by: jesopo <github@lolnerd.net>
Diffstat (limited to 'modules/sed.py')
| -rw-r--r-- | modules/sed.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/modules/sed.py b/modules/sed.py index 460dfd81..77c6f9a2 100644 --- a/modules/sed.py +++ b/modules/sed.py @@ -16,6 +16,11 @@ class Module(object): "channelset").call(setting="sed", help="Disable/Enable sed in a channel", validate=Utils.bool_or_none) + self.bot.events.on("postboot").on("configure").on( + "channelset").call(setting="sed-sender-only", + help= + "Disable/Enable sed only looking at the messages sent by the user", + validate=Utils.bool_or_none) def channel_message(self, event): if event["action"] or not Utils.get_closest_setting(event, "sed", True): @@ -51,7 +56,11 @@ class Module(object): return replace = sed_split[2].replace("\\/", "/") - line = event["channel"].log.find(pattern, from_self=False, not_pattern=REGEX_SED) + for_user = event["user"].nickname if Utils.get_closest_setting( + event, "sed-sender-only", False + ) else None + line = event["channel"].log.find(pattern, from_self=False, + for_user=for_user, not_pattern=REGEX_SED) if line: new_message = re.sub(pattern, replace, line.message, count) if line.action: |
