Check that we have enough PRIVMSG args for strip_color.py
This commit is contained in:
parent
c9de95f44a
commit
5b58cc05b6
1 changed files with 9 additions and 9 deletions
|
@ -12,6 +12,7 @@ class Module(ModuleManager.BaseModule):
|
||||||
@utils.hook("preprocess.send.privmsg")
|
@utils.hook("preprocess.send.privmsg")
|
||||||
@utils.hook("preprocess.send.notice")
|
@utils.hook("preprocess.send.notice")
|
||||||
def preprocess(self, event):
|
def preprocess(self, event):
|
||||||
|
if len(event["line"].args) > 1:
|
||||||
strip_color = event["server"].get_setting("strip-color", False)
|
strip_color = event["server"].get_setting("strip-color", False)
|
||||||
target = event["line"].args[0]
|
target = event["line"].args[0]
|
||||||
if not strip_color and target in event["server"].channels:
|
if not strip_color and target in event["server"].channels:
|
||||||
|
@ -19,6 +20,5 @@ class Module(ModuleManager.BaseModule):
|
||||||
strip_color = channel.get_setting("strip-color", False)
|
strip_color = channel.get_setting("strip-color", False)
|
||||||
|
|
||||||
if strip_color:
|
if strip_color:
|
||||||
message = event["line"].args.get(-1)
|
message = event["line"].args[1]
|
||||||
if not message == None:
|
event["line"].args[1] = utils.irc.strip_font(message)
|
||||||
event["line"].args[-1] = utils.irc.strip_font(message)
|
|
||||||
|
|
Loading…
Reference in a new issue