mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-27 21:22:39 +01:00
Merge pull request #1194 from GLolol/filter/rainbow-stripcolor
Strip colour before applying new colour in Filter.rainbow and colorize
This commit is contained in:
commit
1493adc041
@ -393,7 +393,12 @@ class Filter(callbacks.Plugin):
|
||||
|
||||
Returns <text> with each character randomly colorized.
|
||||
"""
|
||||
if minisix.PY2:
|
||||
text = text.decode('utf-8')
|
||||
text = ircutils.stripColor(text)
|
||||
L = [self._color(c) for c in text]
|
||||
if minisix.PY2:
|
||||
L = [c.encode('utf-8') for c in L]
|
||||
irc.reply('%s%s' % (''.join(L), '\x03'))
|
||||
colorize = wrap(colorize, ['text'])
|
||||
|
||||
@ -405,6 +410,7 @@ class Filter(callbacks.Plugin):
|
||||
"""
|
||||
if minisix.PY2:
|
||||
text = text.decode('utf-8')
|
||||
text = ircutils.stripColor(text)
|
||||
colors = utils.iter.cycle(['05', '04', '07', '08', '09', '03', '11',
|
||||
'10', '12', '02', '06', '13'])
|
||||
L = [self._color(c, fg=next(colors)) for c in text]
|
||||
|
Loading…
Reference in New Issue
Block a user