Changed the code for status table a bit so that it splits up the trades per 50 trades, to make sure it can be sent regardless of number of trades

Signed-off-by: Erwin Hoeckx <hawkeyenl@yahoo.com>
This commit is contained in:
Erwin Hoeckx 2021-03-22 20:40:11 +01:00
parent c010cdf894
commit 4e8999ade3
1 changed files with 6 additions and 2 deletions

View File

@ -330,8 +330,12 @@ class Telegram(RPCHandler):
statlist, head = self._rpc._rpc_status_table(
self._config['stake_currency'], self._config.get('fiat_display_currency', ''))
message = tabulate(statlist, headers=head, tablefmt='simple')
self._send_msg(f"<pre>{message}</pre>", parse_mode=ParseMode.HTML)
max_trades_per_msg = 50
for i in range(0, max(int(len(statlist) / max_trades_per_msg), 1)):
message = tabulate(statlist[i * max_trades_per_msg:(i + 1) * max_trades_per_msg],
headers=head,
tablefmt='simple')
self._send_msg(f"<pre>{message}</pre>", parse_mode=ParseMode.HTML)
except RPCException as e:
self._send_msg(str(e))