From fd8ffef9a245edd4ab64450bb88c4905f7201a13 Mon Sep 17 00:00:00 2001 From: valvesss Date: Fri, 15 May 2020 19:46:18 -0300 Subject: [PATCH] Update stable_api.py --- iqoptionapi/stable_api.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/iqoptionapi/stable_api.py b/iqoptionapi/stable_api.py index 1ae24b6d..bdaf05f8 100644 --- a/iqoptionapi/stable_api.py +++ b/iqoptionapi/stable_api.py @@ -928,12 +928,16 @@ def buy_digital_spot(self, active, amount, action, duration): # And need to be on GMT time #Type - P or C - if action == 'put': - action = 'P' - elif action == 'call': - action = 'C' + if isinstance(action,string): + if action.lower() == 'put': + action = 'P' + elif action.lower() == 'call': + action = 'C' + else: + logging.error('buy_digital_spot active error') + return -1 else: - logging.error('buy_digital_spot active error') + logging.error('buy_digital_spot active error: need action as text') return -1 # doEURUSD201907191250PT5MPSPT timestamp = int(self.api.timesync.server_timestamp)