From 8e87be262c2ac026abbe60c873472d7bf8156678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BA=90=E6=96=87=E9=9B=A8?= <41315874+fumiama@users.noreply.github.com> Date: Mon, 22 Sep 2025 23:06:46 +0800 Subject: [PATCH] fix(aichat): agent group send --- plugin/aichat/main.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugin/aichat/main.go b/plugin/aichat/main.go index acffe960..d698dbd5 100644 --- a/plugin/aichat/main.go +++ b/plugin/aichat/main.go @@ -4,6 +4,7 @@ package aichat import ( "errors" "math/rand" + "reflect" "strconv" "strings" "time" @@ -160,11 +161,12 @@ func init() { logrus.Infoln("[aichat] agent do:", reqs) for _, req := range reqs { if req.Action == "send_group_msg" { - gid, ok := req.Params["group_id"].(int64) - if !ok { + v := reflect.ValueOf(req.Params["group_id"]) + if !v.CanInt() { logrus.Warnln("[aichat] invalid", req.Action, req.Params) continue } + gid = v.Int() if ctx.Event.GroupID != gid && !zero.SuperUserPermission(ctx) { logrus.Warnln("[aichat] refuse to send out of grp from", ctx.Event.GroupID, "to", gid) continue