I connect to the server, but when it starts scanning, the bot closes without giving any errors.
`
def scan():
global twm, conn_keys_prices, conn_keys, prices, perc, client, break_scan, loop, pump_symbol
while True:
try:
if exchange == ‘binance’:
client = BinanceClient(api_key, api_secret)
except Exception as e:
sprint(f”{A}{exchange}{B}”)
print(f”Exception: {e}”)
traceback.print_exc()
exit_pumpbot()
if exchange == 'binance':
sprint(_c)
sprint(_d)
twm = ThreadedWebsocketManager(api_key, api_secret)
twm.start()
break_scan = False
conn_keys = {}
conn_keys_prices = {}
prices = {}
pump_symbol = None
perc = None
symbols = [line[0].lower() + '@trade' for line in tickers]
symbols_prices = [line[0].lower() + '@kline_1m' for line in tickers]
time.sleep(3)
print('SCAN STARTED')
time.sleep(1)
print('Press ESC key to stop scan.')
time.sleep(1)
try:
conn_keys[0] = twm.start_multiplex_socket(callback=process_binance_trade_message, streams=symbols)
conn_keys_prices[0] = twm.start_multiplex_socket(callback=process_binance_kline_message, streams=symbols_prices)
except Exception as e:
print(f"Failed to start websocket: {e}")
traceback.print_exc()
twm.stop()
continue
start = time.time()
Thread(target=start_key_listener).start()
twm.join()
while pump_symbol is None:
if break_scan == False:
time.sleep(0.001)
twm.stop_socket(conn_keys[0])
twm.stop_socket(conn_keys_prices[0])`
I connect to the server, but when it starts scanning, the bot closes without giving any errors.
sulayman is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.