|
@@ -87,11 +87,14 @@ class TradesCommands(InfoCommandsBase):
|
|
|
logger.warning(f"Could not parse trade_time: {trade_time}")
|
|
|
|
|
|
# Add trade ID
|
|
|
- trade_id = trade.get('id', 'unknown')
|
|
|
+ trade_id = str(trade.get('id', 'unknown'))
|
|
|
trades_text += f" 🆔 Trade ID: {trade_id[:8]}\n\n"
|
|
|
|
|
|
except Exception as e:
|
|
|
- logger.error(f"Error processing trade {trade.get('symbol', 'unknown')}: {e}")
|
|
|
+ # The trade object here might be an int if the db issue wasn't fully fixed,
|
|
|
+ # so we safely access symbol only if it's a dict.
|
|
|
+ symbol_for_error = trade.get('symbol', 'unknown') if isinstance(trade, dict) else "unknown"
|
|
|
+ logger.error(f"Error processing trade {symbol_for_error}: {e}")
|
|
|
continue
|
|
|
|
|
|
await self._reply(update, trades_text.strip())
|