File tree Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Expand file tree Collapse file tree 3 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ require (
24
24
github.com/fumiama/cron v1.3.0
25
25
github.com/fumiama/deepinfra v0.0.0-20250920170049-e3d1b92cc3a1
26
26
github.com/fumiama/go-base16384 v1.7.0
27
- github.com/fumiama/go-onebot-agent v0.0.0-20250922144028-320c6b821c49
27
+ github.com/fumiama/go-onebot-agent v0.0.0-20250922152742-c40bb3512d63
28
28
github.com/fumiama/go-registry v0.2.7
29
29
github.com/fumiama/gotracemoe v0.0.3
30
30
github.com/fumiama/jieba v0.0.0-20221203025406-36c17a10b565
Original file line number Diff line number Diff line change @@ -63,8 +63,8 @@ github.com/fumiama/deepinfra v0.0.0-20250920170049-e3d1b92cc3a1 h1:6PglFpNVm3Dal
63
63
github.com/fumiama/deepinfra v0.0.0-20250920170049-e3d1b92cc3a1 /go.mod h1:wW05PQSn8mo1mZIoa6LBUE+3xIBjkoONvnfPTV5ZOhY =
64
64
github.com/fumiama/go-base16384 v1.7.0 h1:6fep7XPQWxRlh4Hu+KsdH+6+YdUp+w6CwRXtMWSsXCA =
65
65
github.com/fumiama/go-base16384 v1.7.0 /go.mod h1:OEn+947GV5gsbTAnyuUW/SrfxJYUdYupSIQXOuGOcXM =
66
- github.com/fumiama/go-onebot-agent v0.0.0-20250922144028-320c6b821c49 h1:5Z+Ljv17X4i/PthL7eVfXq+CKlOnboRlPZeG7Nngyyk =
67
- github.com/fumiama/go-onebot-agent v0.0.0-20250922144028-320c6b821c49 /go.mod h1:wVMgFWkR3GpipL05FkokvrV/jWFIgoEWN1jzUGa0bWg =
66
+ github.com/fumiama/go-onebot-agent v0.0.0-20250922152742-c40bb3512d63 h1:ZdPMPIgZMH4HV4A/JIBb8G7UpLM4iUHWQ8qGjKnKiVI =
67
+ github.com/fumiama/go-onebot-agent v0.0.0-20250922152742-c40bb3512d63 /go.mod h1:wVMgFWkR3GpipL05FkokvrV/jWFIgoEWN1jzUGa0bWg =
68
68
github.com/fumiama/go-registry v0.2.7 h1:tLEqgEpsiybQMqBv0dLHm5leia/z1DhajMupwnOHeNs =
69
69
github.com/fumiama/go-registry v0.2.7 /go.mod h1:m+wp5fF8dYgVoFkBPZl+vlK90loymaJE0JCtocVQLEs =
70
70
github.com/fumiama/go-simple-protobuf v0.2.0 h1:ACyN1MAlu7pDR3EszWgzUeNP+IRsSHwH6V9JCJA5R5o =
Original file line number Diff line number Diff line change 2
2
package aichat
3
3
4
4
import (
5
+ "encoding/json"
5
6
"errors"
6
7
"math/rand"
7
8
"reflect"
@@ -161,12 +162,16 @@ func init() {
161
162
logrus .Infoln ("[aichat] agent do:" , reqs )
162
163
for _ , req := range reqs {
163
164
if req .Action == "send_group_msg" {
164
- v := reflect .ValueOf (req .Params ["group_id" ])
165
- if ! v .CanInt () {
166
- logrus .Warnln ("[aichat] invalid" , req .Action , req .Params )
165
+ v , ok := req .Params ["group_id" ].(json.Number )
166
+ if ! ok {
167
+ logrus .Warnln ("[aichat] invalid group_id type" , reflect .TypeOf (req .Params ["group_id" ]))
168
+ continue
169
+ }
170
+ gid , err = v .Int64 ()
171
+ if ! ok {
172
+ logrus .Warnln ("[aichat] agent conv req gid err:" , err )
167
173
continue
168
174
}
169
- gid = v .Int ()
170
175
if ctx .Event .GroupID != gid && ! zero .SuperUserPermission (ctx ) {
171
176
logrus .Warnln ("[aichat] refuse to send out of grp from" , ctx .Event .GroupID , "to" , gid )
172
177
continue
You can’t perform that action at this time.
0 commit comments