From c91739d6702ffa691ee33c775689841fe26ca85a Mon Sep 17 00:00:00 2001 From: JianFeeeee Date: Sat, 15 Aug 2026 17:24:21 +0800 Subject: [PATCH] =?UTF-8?q?fix(qq):=20parseIDList=20=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E7=A7=91=E5=AD=A6=E8=AE=A1=E6=95=B0=E6=B3=95=E5=AD=98=E5=BA=93?= =?UTF-8?q?=E7=9A=84=E5=8E=86=E5=8F=B2=E5=9D=8F=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 配置里 QQ 号被 WebUI 以科学计数法(2.198972886e+09)存库时, ParseInt 解析失败导致 adminIDs 为空、老大消息不被标记。 ParseInt 失败后回退 ParseFloat, 整数值转为 int64。 --- example/qq/plugin.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/example/qq/plugin.go b/example/qq/plugin.go index 88bdb83..3f416b3 100644 --- a/example/qq/plugin.go +++ b/example/qq/plugin.go @@ -10,6 +10,7 @@ import ( "fmt" "io" "log" + "math" "net" "net/http" "os" @@ -585,6 +586,11 @@ func parseIDList(raw string) []int64 { } if n, err := strconv.ParseInt(part, 10, 64); err == nil && n > 0 { out = append(out, n) + continue + } + // 兼容历史坏数据:科学计数法存库的值(如 2.198972886e+09) + if f, err := strconv.ParseFloat(part, 64); err == nil && f > 0 && f == math.Trunc(f) { + out = append(out, int64(f)) } } return out