Skip to content

Commit

Permalink
refactor: Optimize code for client.py
Browse files Browse the repository at this point in the history
Refactored code in client.py to improve readability and maintainability
  • Loading branch information
SantiiRepair committed Dec 30, 2023
1 parent d660ac6 commit 5b244db
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions quotexpy/ws/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def on_message(self, wss, message):
global_value.started_listen_instruments = True
try:
message = message[1:].decode()
logger.debug(message)
self.logger.debug(message)
message = json.loads(message)
self.api.wss_message = message
if "call" in str(message) or "put" in str(message):
Expand Down Expand Up @@ -147,9 +147,8 @@ def on_open(self, wss):
self.wss.send('42["indicator/list"]')
self.wss.send('42["drawing/load"]')
self.wss.send('42["pending/list"]')
# self.wss.send('42["instruments/update",{"asset":"EURUSD","period":60}]')
self.wss.send('42["chart_notification/get"]')

def on_close(self, wss, close_status_code, close_msg):
"""Method to process websocket close."""
logger.info("Websocket connection closed.")
Expand Down

0 comments on commit 5b244db

Please sign in to comment.