fix: aireply: ent->enr & update README & optimize bilibili match (#519)

This commit is contained in:
莫思潋
2022-12-09 23:23:56 +08:00
committed by GitHub
parent df83ffc8b0
commit 5d9ac50106
4 changed files with 20 additions and 14 deletions

View File

@@ -156,7 +156,7 @@ func init() { // 插件主体
}
ctx.SendChain(message.Text("设置成功"))
})
chatgptfile := ent.DataFolder() + "chatgpt.txt"
chatgptfile := enr.DataFolder() + "chatgpt.txt"
cfg := &chatgpt.Config{
UA: chatgpt.UA,
RefreshInterval: time.Hour,
@@ -178,7 +178,7 @@ func init() { // 插件主体
}
}
}()
ent.OnRegex(`^设置\s*ChatGPT\s*SessionToken\s*(.*)$`, zero.OnlyPrivate, zero.SuperUserPermission).SetBlock(true).Handle(func(ctx *zero.Ctx) {
enr.OnRegex(`^设置\s*ChatGPT\s*SessionToken\s*(.*)$`, zero.OnlyPrivate, zero.SuperUserPermission).SetBlock(true).Handle(func(ctx *zero.Ctx) {
token := ctx.State["regex_matched"].([]string)[1]
f, err := os.Create(chatgptfile)
if err != nil {
@@ -199,7 +199,8 @@ func init() { // 插件主体
})
ctx.SendChain(message.Text("设置成功"))
})
ent.OnFullMatch("重置ChatGPT连接").SetBlock(true).Handle(func(ctx *zero.Ctx) {
enr.OnFullMatch("重置ChatGPT连接").SetBlock(true).Handle(func(ctx *zero.Ctx) {
chats.Reset(ctx.Event.UserID)
ctx.SendChain(message.Text("成功"))
})
}