Fix Rainbows again

master
Sfan5 2013-11-09 20:53:47 +01:00
parent 435e85319c
commit 4a152a9104
1 changed files with 3 additions and 3 deletions

View File

@ -8,8 +8,8 @@ import random
def colorize(text): def colorize(text):
out = "" out = ""
for c in text: for c in text:
if c in [(str(i) for i in range(10))]: if c in list(str(i) for i in range(10)):
c = (u"\u200b".encode("utf8")) + c # 'ZERO WIDTH SPACE' cuz IRC clients are stupid c = u"\u200b" + c # 'ZERO WIDTH SPACE' cuz IRC clients are stupid
out += "\x03" + str(random.randint(2, 15)) + c out += "\x03" + str(random.randint(2, 15)) + c
return out return out
@ -20,7 +20,7 @@ def rainbow(phenny, input):
return # Abort function return # Abort function
arg = input.group(2) arg = input.group(2)
if not arg: if not arg:
phenny.say(colorize("Rainbow") + "What?") return phenny.say(colorize("Rainbow") + "\x03 What?")
phenny.say(colorize(arg)) phenny.say(colorize(arg))
rainbow.commands = ['rainbow'] rainbow.commands = ['rainbow']