We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8811df5 commit 8e87be2Copy full SHA for 8e87be2
1 file changed
plugin/aichat/main.go
@@ -4,6 +4,7 @@ package aichat
4
import (
5
"errors"
6
"math/rand"
7
+ "reflect"
8
"strconv"
9
"strings"
10
"time"
@@ -160,11 +161,12 @@ func init() {
160
161
logrus.Infoln("[aichat] agent do:", reqs)
162
for _, req := range reqs {
163
if req.Action == "send_group_msg" {
- gid, ok := req.Params["group_id"].(int64)
164
- if !ok {
+ v := reflect.ValueOf(req.Params["group_id"])
165
+ if !v.CanInt() {
166
logrus.Warnln("[aichat] invalid", req.Action, req.Params)
167
continue
168
}
169
+ gid = v.Int()
170
if ctx.Event.GroupID != gid && !zero.SuperUserPermission(ctx) {
171
logrus.Warnln("[aichat] refuse to send out of grp from", ctx.Event.GroupID, "to", gid)
172
0 commit comments