utils.irc.color should take int for foreground/background, not str

This commit is contained in:
jesopo 2018-11-02 13:14:42 +00:00
parent 9b2040e280
commit 9fe7815c17

View file

@ -98,7 +98,7 @@ FONT_BOLD, FONT_ITALIC, FONT_UNDERLINE, FONT_INVERT = ("\x02", "\x1D",
FONT_COLOR, FONT_RESET = "\x03", "\x0F"
REGEX_COLOR = re.compile("%s\d\d(?:,\d\d)?" % FONT_COLOR)
def color(s: str, foreground: str, background: str=None) -> str:
def color(s: str, foreground: int, background: int=None) -> str:
foreground = str(foreground).zfill(2)
if background:
background = str(background).zfill(2)