mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 05:30:07 +08:00
fix(aichat): agent group send
This commit is contained in:
parent
8811df5968
commit
8e87be262c
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user