diff --git a/notification_sound.py b/notification_sound.py index a3e9e60..9aaa4b8 100644 --- a/notification_sound.py +++ b/notification_sound.py @@ -20,11 +20,10 @@ def on_open(ws): print('Websocket opened') def on_close(ws, *error): print('Websocket closed, attempting to reconnect') - connect_websocket() - def connect_websocket(): ws = websocket.WebSocketApp("wss://" + config['instance'].split('/')[-1] + "/api/v1/streaming?access_token=" + config['user_token'] + "&stream=user:notification", on_message = on_message, on_open = on_open, on_close = on_close, on_error=on_close) ws.run_forever() -connect_websocket() \ No newline at end of file +while True: + connect_websocket() \ No newline at end of file