Selaa lähdekoodia

Add info commands to trading command map for enhanced user access to trading data. This update includes commands for balance, positions, orders, stats, price, market, performance, daily, weekly, monthly, trades, and risk, improving the overall functionality and user experience of the trading interface.

Carles Sentis 1 viikko sitten
vanhempi
sitoutus
ad47c1b8ce
2 muutettua tiedostoa jossa 18 lisäystä ja 5 poistoa
  1. 17 4
      src/commands/trading_commands.py
  2. 1 1
      trading_bot.py

+ 17 - 4
src/commands/trading_commands.py

@@ -637,6 +637,23 @@ This action cannot be undone.
                 # Add other management commands here if they have quick action buttons
             })
 
+        # Add info commands to the map
+        if hasattr(self, 'info_commands_handler'):
+            command_action_map.update({
+                "balance": self.info_commands_handler.balance_command,
+                "positions": self.info_commands_handler.positions_command,
+                "orders": self.info_commands_handler.orders_command,
+                "stats": self.info_commands_handler.stats_command,
+                "price": self.info_commands_handler.price_command,
+                "market": self.info_commands_handler.market_command,
+                "performance": self.info_commands_handler.performance_command,
+                "daily": self.info_commands_handler.daily_command,
+                "weekly": self.info_commands_handler.weekly_command,
+                "monthly": self.info_commands_handler.monthly_command,
+                "trades": self.info_commands_handler.trades_command,
+                "risk": self.info_commands_handler.risk_command,
+            })
+
         # Prepare key for map lookup, stripping leading '/' if present for general commands
         mapped_command_key = callback_data
         if callback_data.startswith('/') and not callback_data.startswith('/confirm_'): # Avoid stripping for confirm actions
@@ -663,10 +680,6 @@ This action cannot be undone.
             return # Handled
 
         # Special handling for 'help' callback from InfoCommands quick menu
-        # This check should use the modified key as well if we want /help to work via this mechanism
-        # However, the 'help' key in command_action_map is 'help', not '/help'.
-        # The current 'help' handling is separate and specific. Let's adjust it for consistency if needed or verify.
-        # The previous change to info_commands.py made help callback_data='/help'.
         if callback_data == "/help": # Check for the actual callback_data value
             logger.info("Handling '/help' button callback. Guiding user to /help command.")
             try:

+ 1 - 1
trading_bot.py

@@ -14,7 +14,7 @@ from datetime import datetime
 from pathlib import Path
 
 # Bot version
-BOT_VERSION = "2.4.200"
+BOT_VERSION = "2.4.201"
 
 # Add src directory to Python path
 sys.path.insert(0, str(Path(__file__).parent / "src"))