Added error information output #28
@@ -71,7 +71,7 @@ class TelegramMessageHandler:
 | 
				
			|||||||
            auto_trading = (
 | 
					            auto_trading = (
 | 
				
			||||||
                user_auto_trading.auto_trading if user_auto_trading else False
 | 
					                user_auto_trading.auto_trading if user_auto_trading else False
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
            if auto_trading:
 | 
					
 | 
				
			||||||
            side_rus = (
 | 
					            side_rus = (
 | 
				
			||||||
                "Покупка"
 | 
					                "Покупка"
 | 
				
			||||||
                if side == "Buy"
 | 
					                if side == "Buy"
 | 
				
			||||||
@@ -193,12 +193,16 @@ class TelegramMessageHandler:
 | 
				
			|||||||
                             "Не удалось установить ТП и СЛ\n")
 | 
					                             "Не удалось установить ТП и СЛ\n")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
 | 
					                if auto_trading:
 | 
				
			||||||
                    new_pnl = safe_float(pnl_series) + total_pnl
 | 
					                    new_pnl = safe_float(pnl_series) + total_pnl
 | 
				
			||||||
                    await rq.set_pnl_series_by_symbol(
 | 
					                    await rq.set_pnl_series_by_symbol(
 | 
				
			||||||
                        tg_id=tg_id, symbol=symbol, pnl_series=new_pnl)
 | 
					                        tg_id=tg_id, symbol=symbol, pnl_series=new_pnl)
 | 
				
			||||||
                    text += f"\nПрибыль без комиссии: {ex_pnl:.4f}\n"
 | 
					                    text += f"\nПрибыль без комиссии: {ex_pnl:.4f}\n"
 | 
				
			||||||
                    text += f"Реализованная прибыль: {total_pnl:.4f}\n"
 | 
					                    text += f"Реализованная прибыль: {total_pnl:.4f}\n"
 | 
				
			||||||
                    text += f"Прибыль серии: {safe_float(new_pnl):.4f}\n"
 | 
					                    text += f"Прибыль серии: {safe_float(new_pnl):.4f}\n"
 | 
				
			||||||
 | 
					                else:
 | 
				
			||||||
 | 
					                    text += f"\nПрибыль без комиссии: {ex_pnl:.4f}\n"
 | 
				
			||||||
 | 
					                    text += f"Реализованная прибыль: {total_pnl:.4f}\n"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            await self.telegram_bot.send_message(
 | 
					            await self.telegram_bot.send_message(
 | 
				
			||||||
                chat_id=tg_id, text=text, reply_markup=kbi.profile_bybit
 | 
					                chat_id=tg_id, text=text, reply_markup=kbi.profile_bybit
 | 
				
			||||||
@@ -308,6 +312,5 @@ class TelegramMessageHandler:
 | 
				
			|||||||
                            text=error_text,
 | 
					                            text=error_text,
 | 
				
			||||||
                            reply_markup=kbi.profile_bybit,
 | 
					                            reply_markup=kbi.profile_bybit,
 | 
				
			||||||
                        )
 | 
					                        )
 | 
				
			||||||
 | 
					 | 
				
			||||||
        except Exception as e:
 | 
					        except Exception as e:
 | 
				
			||||||
            logger.error("Error in telegram_message_handler: %s", e, exc_info=True)
 | 
					            logger.error("Error in telegram_message_handler: %s", e, exc_info=True)
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user