@@ -11,8 +11,8 @@ import (
11
11
zero "github.com/wdvxdr1123/ZeroBot"
12
12
"github.com/wdvxdr1123/ZeroBot/message"
13
13
14
+ "github.com/FloatTech/AnimeAPI/airecord"
14
15
ctrl "github.com/FloatTech/zbpctrl"
15
- "github.com/FloatTech/zbputils/airecord"
16
16
"github.com/FloatTech/zbputils/control"
17
17
)
18
18
@@ -36,7 +36,11 @@ func init() {
36
36
ctx .SendChain (message .Text ("ERROR: parse gid err: " , err ))
37
37
return
38
38
}
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
+ }
40
44
ctx .SendChain (message .Text ("设置AI语音群号为" , num ))
41
45
})
42
46
en .OnFullMatch ("设置AI语音模型" , zero .SuperUserPermission ).SetBlock (true ).
@@ -98,7 +102,11 @@ func init() {
98
102
ctx .SendChain (message .Text ("序号非法!" ))
99
103
continue
100
104
}
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
+ }
102
110
ctx .SendChain (message .Text ("已选择语音模型: " , names [num ]))
103
111
ctx .SendChain (message .Record (nameToURL [names [num ]]))
104
112
return
@@ -107,13 +115,13 @@ func init() {
107
115
})
108
116
en .OnFullMatch ("查看AI语音配置" ).SetBlock (true ).
109
117
Handle (func (ctx * zero.Ctx ) {
110
- recCfg := airecord .GetRecordConfig ()
118
+ recCfg := airecord .RecCfg
111
119
ctx .SendChain (message .Text (airecord .PrintRecordConfig (recCfg )))
112
120
})
113
121
en .OnPrefix ("发送AI语音" ).SetBlock (true ).
114
122
Handle (func (ctx * zero.Ctx ) {
115
123
u := strings .TrimSpace (ctx .State ["args" ].(string ))
116
- recCfg := airecord .GetRecordConfig ()
124
+ recCfg := airecord .RecCfg
117
125
record := ctx .GetAIRecord (recCfg .ModelID , recCfg .Customgid , u )
118
126
if record == "" {
119
127
id := ctx .SendGroupAIRecord (recCfg .ModelID , ctx .Event .GroupID , u )
0 commit comments