mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-18 08:02:49 +01:00
Fix KeyError when using colors in a message containing numbers.
This commit is contained in:
parent
ceee427e1f
commit
c39ad2f379
@ -280,7 +280,13 @@ def mircColor(s, fg=None, bg=None):
|
|||||||
if fg is None and bg is None:
|
if fg is None and bg is None:
|
||||||
return s
|
return s
|
||||||
elif bg is None:
|
elif bg is None:
|
||||||
|
if str(fg) in mircColors:
|
||||||
fg = mircColors[str(fg)]
|
fg = mircColors[str(fg)]
|
||||||
|
elif len(str(fg)) > 1:
|
||||||
|
fg = mircColors[str(fg)[:-1]]
|
||||||
|
else:
|
||||||
|
# Should not happen
|
||||||
|
pass
|
||||||
return '\x03%s%s\x03' % (fg.zfill(2), s)
|
return '\x03%s%s\x03' % (fg.zfill(2), s)
|
||||||
elif fg is None:
|
elif fg is None:
|
||||||
bg = mircColors[str(bg)]
|
bg = mircColors[str(bg)]
|
||||||
|
Loading…
Reference in New Issue
Block a user