Closed SharpBit closed 6 years ago
Traceback (most recent call last): File "bot.py", line 79, in get_questions await networking.websocket_handler(socket, headers) File "/app/networking.py", line 56, in websocket_handler message = re.sub(r"[\x00-\x1f\x7f-\x9f]", "", message) UnboundLocalError: local variable 'message' referenced before assignment
Just got that ^ this is the code:
for msg in websocket.connect(ping_rate=5): if msg.name == "text": message = msg.text message = re.sub(r"[\x00-\x1f\x7f-\x9f]", "", message)
@Exaphis I'm pretty sure that means msg.name != 'text'. This never happened before.
msg.name != 'text'
Your file has some weird indentation issues and is different from networking.py on Github. Please clone the repo again or indent everything so that it is under the if statement.
networking.py
whoops, just saw it. Thanks
Just got that ^ this is the code:
@Exaphis I'm pretty sure that means
msg.name != 'text'
. This never happened before.