fix: перевести Telegram уведомления на русский
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -194,9 +194,9 @@ def daemon():
|
||||
|
||||
# Notify: bot started
|
||||
if cfg.telegram.enabled:
|
||||
info = (f"Host: <code>{platform.node()}</code>\n"
|
||||
f"TF: {cfg.timeframe}, Assets: {len(cfg.assets)}\n"
|
||||
f"Mode: {cfg.mode}")
|
||||
info = (f"Сервер: <code>{platform.node()}</code>\n"
|
||||
f"Таймфрейм: {cfg.timeframe}, Активов: {len(cfg.assets)}\n"
|
||||
f"Режим: {cfg.mode}")
|
||||
send_status(cfg.telegram, "start", info)
|
||||
|
||||
def scheduled_cycle():
|
||||
|
||||
@@ -34,10 +34,15 @@ def send_telegram(cfg: TelegramConfig, message: str) -> bool:
|
||||
|
||||
def send_status(cfg: TelegramConfig, event: str, details: str = "") -> bool:
|
||||
"""Send bot status notification (start, stop, restart, error)."""
|
||||
icons = {"start": "\u2705", "restart": "\U0001f504", "stop": "\u26d4",
|
||||
"error": "\u26a0\ufe0f", "crash": "\U0001f4a5"}
|
||||
icon = icons.get(event, "\u2139\ufe0f")
|
||||
msg = f"{icon} <b>RemizovTrader — {event.upper()}</b>"
|
||||
labels = {
|
||||
"start": ("\u2705", "ЗАПУЩЕН"),
|
||||
"restart": ("\U0001f504", "ПЕРЕЗАПУЩЕН"),
|
||||
"stop": ("\u26d4", "ОСТАНОВЛЕН"),
|
||||
"error": ("\u26a0\ufe0f", "ОШИБКА"),
|
||||
"crash": ("\U0001f4a5", "СБОЙ"),
|
||||
}
|
||||
icon, label = labels.get(event, ("\u2139\ufe0f", event.upper()))
|
||||
msg = f"{icon} <b>RemizovTrader — {label}</b>"
|
||||
if details:
|
||||
msg += f"\n{details}"
|
||||
return send_telegram(cfg, msg)
|
||||
@@ -46,7 +51,7 @@ def send_status(cfg: TelegramConfig, event: str, details: str = "") -> bool:
|
||||
def format_cycle_report(logs: list[str]) -> str:
|
||||
"""Format cycle logs into a Telegram message."""
|
||||
if not logs:
|
||||
return "<b>RemizovTrader</b>\nCycle complete — no activity."
|
||||
return "<b>RemizovTrader</b>\nЦикл завершён — без активности."
|
||||
|
||||
lines = ["<b>RemizovTrader</b>"]
|
||||
for msg in logs:
|
||||
|
||||
Reference in New Issue
Block a user