@@ -11,8 +11,8 @@ import (
1111 zero "github.com/wdvxdr1123/ZeroBot"
1212 "github.com/wdvxdr1123/ZeroBot/message"
1313
14+ "github.com/FloatTech/AnimeAPI/airecord"
1415 ctrl "github.com/FloatTech/zbpctrl"
15- "github.com/FloatTech/zbputils/airecord"
1616 "github.com/FloatTech/zbputils/control"
1717)
1818
@@ -36,7 +36,11 @@ func init() {
3636 ctx .SendChain (message .Text ("ERROR: parse gid err: " , err ))
3737 return
3838 }
39- airecord .SetCustomGID (num )
39+ err = airecord .SetCustomGID (num )
40+ if err != nil {
41+ ctx .SendChain (message .Text ("ERROR: set gid err: " , err ))
42+ return
43+ }
4044 ctx .SendChain (message .Text ("设置AI语音群号为" , num ))
4145 })
4246 en .OnFullMatch ("设置AI语音模型" , zero .SuperUserPermission ).SetBlock (true ).
@@ -98,7 +102,11 @@ func init() {
98102 ctx .SendChain (message .Text ("序号非法!" ))
99103 continue
100104 }
101- airecord .SetRecordModel (names [num ], nameToID [names [num ]])
105+ err = airecord .SetRecordModel (names [num ], nameToID [names [num ]])
106+ if err != nil {
107+ ctx .SendChain (message .Text ("ERROR: set model err: " , err ))
108+ continue
109+ }
102110 ctx .SendChain (message .Text ("已选择语音模型: " , names [num ]))
103111 ctx .SendChain (message .Record (nameToURL [names [num ]]))
104112 return
@@ -107,13 +115,13 @@ func init() {
107115 })
108116 en .OnFullMatch ("查看AI语音配置" ).SetBlock (true ).
109117 Handle (func (ctx * zero.Ctx ) {
110- recCfg := airecord .GetRecordConfig ()
118+ recCfg := airecord .RecCfg
111119 ctx .SendChain (message .Text (airecord .PrintRecordConfig (recCfg )))
112120 })
113121 en .OnPrefix ("发送AI语音" ).SetBlock (true ).
114122 Handle (func (ctx * zero.Ctx ) {
115123 u := strings .TrimSpace (ctx .State ["args" ].(string ))
116- recCfg := airecord .GetRecordConfig ()
124+ recCfg := airecord .RecCfg
117125 record := ctx .GetAIRecord (recCfg .ModelID , recCfg .Customgid , u )
118126 if record == "" {
119127 id := ctx .SendGroupAIRecord (recCfg .ModelID , ctx .Event .GroupID , u )
0 commit comments