I tried:
Syntax: Select all
RE_STRIP_COLORS = re.compile(r'\x07[a-fA-F0-9]{6}|\x08[a-fA-F0-9]{8}')
def strip_colors(message):
print(type(message))
return RE_STRIP_COLORS.sub('', message)
def tell_console(index, message):
message = strip_colors(message)
TextMsg(message, HudDestination.CONSOLE).send(index)
but i'm getting
Code: Select all
<class 'translations.strings.TranslationStrings'>
return RE_STRIP_COLORS.sub('', message)
TypeError: expected string or bytes-like object