mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-19 13:59:39 +08:00
fix(aichat): agent group send
This commit is contained in:
parent
8811df5968
commit
8e87be262c
@ -4,6 +4,7 @@ package aichat
|
|||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"math/rand"
|
"math/rand"
|
||||||
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
@ -160,11 +161,12 @@ func init() {
|
|||||||
logrus.Infoln("[aichat] agent do:", reqs)
|
logrus.Infoln("[aichat] agent do:", reqs)
|
||||||
for _, req := range reqs {
|
for _, req := range reqs {
|
||||||
if req.Action == "send_group_msg" {
|
if req.Action == "send_group_msg" {
|
||||||
gid, ok := req.Params["group_id"].(int64)
|
v := reflect.ValueOf(req.Params["group_id"])
|
||||||
if !ok {
|
if !v.CanInt() {
|
||||||
logrus.Warnln("[aichat] invalid", req.Action, req.Params)
|
logrus.Warnln("[aichat] invalid", req.Action, req.Params)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
gid = v.Int()
|
||||||
if ctx.Event.GroupID != gid && !zero.SuperUserPermission(ctx) {
|
if ctx.Event.GroupID != gid && !zero.SuperUserPermission(ctx) {
|
||||||
logrus.Warnln("[aichat] refuse to send out of grp from", ctx.Event.GroupID, "to", gid)
|
logrus.Warnln("[aichat] refuse to send out of grp from", ctx.Event.GroupID, "to", gid)
|
||||||
continue
|
continue
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user