ボットが止まる。

最近止まらなくなったのに止まった。

 

Traceback (most recent call last):
  File "/home/ubuntu/shRSI1_1.py", line 149, in start
    print_log("Equity:{0} Available_Balance:{1} wallet_balance:{2} [BTC]".format(data['result']['BTC']['equity'],data['result']['BTC']['available_balance'],data['result']['BTC']['wallet_balance']))
TypeError: 'NoneType' object is not subscriptable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ubuntu/shRSI1_1.py", line 249, in <module>
    asyncio.run(start(max_lot, lot, interval, plot_interval))
  File "/usr/local/lib/python3.9/asyncio/runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/home/ubuntu/shRSI1_1.py", line 165, in start
    print_log(e)
  File "/home/ubuntu/shRSI1_1.py", line 59, in print_log
    discord.post(content=text)
  File "/home/ubuntu/.local/lib/python3.9/site-packages/discordwebhook/discordwebhook.py", line 40, in post
    self.url, json.dumps(data), headers={"Content-Type": "application/json"}
  File "/usr/local/lib/python3.9/json/__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "/usr/local/lib/python3.9/json/encoder.py", line 199, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/local/lib/python3.9/json/encoder.py", line 257, in iterencode
    return _iterencode(o, 0)
  File "/usr/local/lib/python3.9/json/encoder.py", line 179, in default
    raise TypeError(f'Object of type {o.__class__.__name__} '
TypeError: Object of type TypeError is not JSON serializable

 

なんだろうか。

 

orders = await client.get('/v2/private/wallet/balance',params={'coin':'BTC'})
data = await orders.json

print_log("Equity:{0} Available_Balance:{1} wallet_balance:{2} [BTC]".format(data['result']['BTC']['equity'],data['result']['BTC']['available_balance'],data['result']['BTC']['wallet_balance']))

 

いや違う。毎回ここなんだ。1日1回しか更新されないみたいだから。

bybit-exchange.github.io