aboutsummaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorGravatar jesopo2019-06-16 09:52:04 +0100
committerGravatar jesopo2019-06-16 09:52:04 +0100
commit5b58cc05b64424f50d98d63ab7a026b4100b7693 (patch)
treec17e1f9b903ff1747ee2b4d306507c89bd668aaa /modules
parentforgot to pass `stdout` and `stderr` to command callbacks! (diff)
signature
Check that we have enough PRIVMSG args for strip_color.py
Diffstat (limited to 'modules')
-rw-r--r--modules/strip_color.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/modules/strip_color.py b/modules/strip_color.py
index f5e16027..28288209 100644
--- a/modules/strip_color.py
+++ b/modules/strip_color.py
@@ -12,13 +12,13 @@ class Module(ModuleManager.BaseModule):
@utils.hook("preprocess.send.privmsg")
@utils.hook("preprocess.send.notice")
def preprocess(self, event):
- strip_color = event["server"].get_setting("strip-color", False)
- target = event["line"].args[0]
- if not strip_color and target in event["server"].channels:
- channel = event["server"].channels.get(target)
- strip_color = channel.get_setting("strip-color", False)
+ if len(event["line"].args) > 1:
+ strip_color = event["server"].get_setting("strip-color", False)
+ target = event["line"].args[0]
+ if not strip_color and target in event["server"].channels:
+ channel = event["server"].channels.get(target)
+ strip_color = channel.get_setting("strip-color", False)
- if strip_color:
- message = event["line"].args.get(-1)
- if not message == None:
- event["line"].args[-1] = utils.irc.strip_font(message)
+ if strip_color:
+ message = event["line"].args[1]
+ event["line"].args[1] = utils.irc.strip_font(message)