|
@@ -15,7 +15,6 @@ from src.trading.trading_engine import TradingEngine
|
|
|
from src.monitoring.market_monitor import MarketMonitor
|
|
|
from src.notifications.notification_manager import NotificationManager
|
|
|
from src.commands.trading_commands import TradingCommands
|
|
|
-from src.commands.info_commands import InfoCommands
|
|
|
from src.commands.management_commands import ManagementCommands
|
|
|
from src.commands.info.balance import BalanceCommands
|
|
|
from src.commands.info.positions import PositionsCommands
|
|
@@ -28,6 +27,9 @@ from src.commands.info.daily import DailyCommands
|
|
|
from src.commands.info.weekly import WeeklyCommands
|
|
|
from src.commands.info.monthly import MonthlyCommands
|
|
|
from src.commands.info.risk import RiskCommands
|
|
|
+from src.commands.info.price import PriceCommands
|
|
|
+from src.commands.info.balance_adjustments import BalanceAdjustmentsCommands
|
|
|
+from src.commands.info.commands import CommandsCommands
|
|
|
|
|
|
logger = logging.getLogger(__name__)
|
|
|
|
|
@@ -49,11 +51,9 @@ class TelegramTradingBot:
|
|
|
self.trading_engine.set_market_monitor(self.market_monitor)
|
|
|
|
|
|
# Initialize command handlers
|
|
|
- self.info_commands = InfoCommands(self.trading_engine, self.notification_manager)
|
|
|
self.management_commands = ManagementCommands(self.trading_engine, self.market_monitor)
|
|
|
# Pass info and management command handlers to TradingCommands
|
|
|
self.trading_commands = TradingCommands(self.trading_engine, self.notification_manager,
|
|
|
- info_commands_handler=self.info_commands,
|
|
|
management_commands_handler=self.management_commands)
|
|
|
|
|
|
def is_authorized(self, chat_id: str) -> bool:
|
|
@@ -103,6 +103,9 @@ class TelegramTradingBot:
|
|
|
self.weekly_cmds = WeeklyCommands(self.trading_engine, self.notification_manager)
|
|
|
self.monthly_cmds = MonthlyCommands(self.trading_engine, self.notification_manager)
|
|
|
self.risk_cmds = RiskCommands(self.trading_engine, self.notification_manager)
|
|
|
+ self.price_cmds = PriceCommands(self.trading_engine, self.notification_manager)
|
|
|
+ self.balance_adjustments_cmds = BalanceAdjustmentsCommands(self.trading_engine, self.notification_manager)
|
|
|
+ self.commands_cmds = CommandsCommands(self.trading_engine, self.notification_manager)
|
|
|
|
|
|
# Info commands
|
|
|
self.application.add_handler(CommandHandler("balance", self.balance_cmds.balance_command))
|
|
@@ -111,15 +114,15 @@ class TelegramTradingBot:
|
|
|
self.application.add_handler(CommandHandler("stats", self.stats_cmds.stats_command))
|
|
|
self.application.add_handler(CommandHandler("trades", self.trades_cmds.trades_command))
|
|
|
self.application.add_handler(CommandHandler("market", self.market_cmds.market_command))
|
|
|
- self.application.add_handler(CommandHandler("price", self.info_commands.price_command))
|
|
|
+ self.application.add_handler(CommandHandler("price", self.price_cmds.price_command))
|
|
|
self.application.add_handler(CommandHandler("performance", self.performance_cmds.performance_command))
|
|
|
self.application.add_handler(CommandHandler("daily", self.daily_cmds.daily_command))
|
|
|
self.application.add_handler(CommandHandler("weekly", self.weekly_cmds.weekly_command))
|
|
|
self.application.add_handler(CommandHandler("monthly", self.monthly_cmds.monthly_command))
|
|
|
self.application.add_handler(CommandHandler("risk", self.risk_cmds.risk_command))
|
|
|
- self.application.add_handler(CommandHandler("balance_adjustments", self.info_commands.balance_adjustments_command))
|
|
|
- self.application.add_handler(CommandHandler("commands", self.info_commands.commands_command))
|
|
|
- self.application.add_handler(CommandHandler("c", self.info_commands.commands_command)) # Alias
|
|
|
+ self.application.add_handler(CommandHandler("balance_adjustments", self.balance_adjustments_cmds.balance_adjustments_command))
|
|
|
+ self.application.add_handler(CommandHandler("commands", self.commands_cmds.commands_command))
|
|
|
+ self.application.add_handler(CommandHandler("c", self.commands_cmds.commands_command)) # Alias
|
|
|
|
|
|
# Management commands
|
|
|
self.application.add_handler(CommandHandler("monitoring", self.management_commands.monitoring_command))
|