diff options
| author | 2019-02-23 21:40:11 +0000 | |
|---|---|---|
| committer | 2019-02-23 21:40:11 +0000 | |
| commit | 1473f41b03585af77ebd19aac915b99347514287 (patch) | |
| tree | 72c6f6b190c0f85d401f9b00da375a0c930e536d /modules | |
| parent | Make IRCArgs mutable (diff) | |
| signature | ||
Fire preprocess.send per-command - use this to only strip colors from ParsedLine
objects for PRIVMSG and NOTICE
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/strip_color.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/strip_color.py b/modules/strip_color.py index a1bfa752..37ce9900 100644 --- a/modules/strip_color.py +++ b/modules/strip_color.py @@ -4,7 +4,9 @@ from src import ModuleManager, utils "help": "Set whether I strip colors from my messages on this server", "validate": utils.bool_or_none}) class Module(ModuleManager.BaseModule): - @utils.hook("preprocess.send") + @utils.hook("preprocess.send.privmsg") + @utils.hook("preprocess.send.notice") def preprocess(self, event): if event["server"].get_setting("strip-color", False): - return utils.irc.strip_font(event["line"]) + line = event["line"] + line.args[-1] = utils.irc.strip_font(line.args[-1]) |
