diff --git a/src/remizov_trader/cli.py b/src/remizov_trader/cli.py index 87eb25a..efa927f 100644 --- a/src/remizov_trader/cli.py +++ b/src/remizov_trader/cli.py @@ -290,8 +290,8 @@ def _send_with_keyboard(cfg, text: str, keyboard=None): # Persistent reply keyboard (bottom of screen) _REPLY_KEYBOARD = { "keyboard": [ - [{"text": "\U0001f4ca Статус"}, {"text": "\U0001f4b0 Баланс"}], - [{"text": "\u2696\ufe0f Плечо"}, {"text": "\u2753 Помощь"}], + [{"text": "\U0001f4ca Статус"}, {"text": "\U0001f4cb Отчёт"}], + [{"text": "\U0001f4b0 Баланс"}, {"text": "\u2696\ufe0f Плечо"}, {"text": "\u2753 Помощь"}], ], "resize_keyboard": True, "is_persistent": True, @@ -304,6 +304,7 @@ def _send_help(cfg): "\U0001f916 RemizovTrader — Команды\n" "\n" "/status — портфель, позиции, статистика\n" + "/report — утренний отчёт (сделки, PnL, валидация)\n" "/balance — баланс на бирже\n" "/leverage — текущее плечо\n" "/leverage N — установить плечо (1-10)\n" @@ -365,7 +366,7 @@ def _start_telegram_listener(cfg, get_db_fn): import httpx - from .notify import format_status_report, send_telegram + from .notify import format_morning_report, format_status_report, send_telegram # Map button text to commands _button_map = { @@ -373,6 +374,7 @@ def _start_telegram_listener(cfg, get_db_fn): "\U0001f4b0 баланс": "/balance", "\u2696\ufe0f плечо": "/leverage", "\u2753 помощь": "/help", + "\U0001f4cb отчёт": "/report", } def handle_command(text: str): @@ -384,6 +386,11 @@ def _start_telegram_listener(cfg, get_db_fn): report = format_status_report(cfg, conn) conn.close() send_telegram(cfg.telegram, report) + elif cmd == "/report": + conn = get_db_fn() + report = format_morning_report(cfg, conn) + conn.close() + send_telegram(cfg.telegram, report) elif cmd == "/leverage": _handle_leverage(cfg, mapped, send_telegram) elif cmd == "/balance":