From 6e04af5f657d3c819931a85ad181bc1291967914 Mon Sep 17 00:00:00 2001 From: "2569718930@qq.com" <2569718930@qq.com> Date: Wed, 25 Feb 2026 19:46:01 +0800 Subject: [PATCH] feat: Introduce `!forecast` and `!help` commands, refactor `!weather` to use `process_command`, and enable "ping" alias. --- bot_listener.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bot_listener.py b/bot_listener.py index 66a92032..1a8a3803 100644 --- a/bot_listener.py +++ b/bot_listener.py @@ -133,7 +133,10 @@ def analyze_weather_trend(weather_data, temp_symbol): # === 博弈区间提醒 (基于 WU 四舍五入结算) === if len(labeled_forecasts) >= 2: - settlement_vals = sorted(set(round(v) for _, v in labeled_forecasts)) + import math + # 用标准四舍五入 (6.5→7),不用 Python 的银行家舍入 (6.5→6) + wu_round = lambda v: math.floor(v + 0.5) + settlement_vals = sorted(set(wu_round(v) for _, v in labeled_forecasts)) unit_short = temp_symbol if len(settlement_vals) == 1: insights.append(f"🎲 博弈区间:{len(labeled_forecasts)}个模型全部指向 {settlement_vals[0]}{unit_short} 结算。")