This commit is contained in:
algizn97
2025-10-03 14:19:18 +05:00
parent 4adbd70948
commit 1508629727
15 changed files with 412 additions and 210 deletions

View File

@@ -43,6 +43,12 @@ async def set_switch_position_mode(tg_id: int, symbol: str, mode: int) -> str |
tg_id,
)
return "You have an existing position, so position mode cannot be switched"
if str(e).startswith("Open orders exist, so you cannot change position mode"):
logger.debug(
"Open orders exist, so you cannot change position mode for user: %s",
tg_id,
)
return "Open orders exist, so you cannot change position mode"
else:
logger.error("Error connecting to Bybit for user %s: %s", tg_id, e)
return False