Update discord_connector.py

This commit is contained in:
slikie 2023-04-18 16:08:58 +08:00 committed by GitHub
parent 6fcfc50107
commit d117a83e63
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -757,11 +757,9 @@ class DiscordConnector:
# Connection was closed in the meantime
return True
recv, _w, _e = select.select((self.websocket.sock,), (), (), 0)
except websocket.WebSocketConnectionClosedException:
except (websocket.WebSocketConnectionClosedException, json.decoder.JSONDecodeError):
self.on_close()
return True
except json.decoder.JSONDecodeError:
return True
return True
def start_listening_text(self, channel):