File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,7 @@ func init() {
50
50
mf := en .DataFolder () + "model.txt"
51
51
sf := en .DataFolder () + "system.txt"
52
52
pf := en .DataFolder () + "sep.txt"
53
+ nf := en .DataFolder () + "NoReplyAT"
53
54
if file .IsExist (mf ) {
54
55
data , err := os .ReadFile (mf )
55
56
if err != nil {
@@ -74,6 +75,7 @@ func init() {
74
75
sepstr = string (data )
75
76
}
76
77
}
78
+ noreplyat = file .IsExist (nf )
77
79
78
80
en .OnMessage (func (ctx * zero.Ctx ) bool {
79
81
return ctx .ExtractPlainText () != "" && (! noreplyat || (noreplyat && ! ctx .Event .IsToMe ))
@@ -275,9 +277,8 @@ func init() {
275
277
en .OnRegex ("^设置AI聊天(不)?响应AT$" , zero .OnlyPrivate , zero .SuperUserPermission ).SetBlock (true ).Handle (func (ctx * zero.Ctx ) {
276
278
args := ctx .State ["regex_matched" ].([]string )
277
279
isno := args [1 ] == "不"
278
- fp := en .DataFolder () + "NoReplyAT"
279
280
if isno {
280
- f , err := os .Create (fp )
281
+ f , err := os .Create (nf )
281
282
if err != nil {
282
283
ctx .SendChain (message .Text ("ERROR: " , err ))
283
284
return
@@ -290,7 +291,7 @@ func init() {
290
291
}
291
292
noreplyat = true
292
293
} else {
293
- _ = os .Remove (fp )
294
+ _ = os .Remove (nf )
294
295
noreplyat = false
295
296
}
296
297
ctx .SendChain (message .Text ("成功" ))
You can’t perform that action at this time.
0 commit comments