添加签到,引入分数机制 (#101)

* feat:添加签到功能,引入分数机制

* feat:修lint

* fix:加宽

* fix:修lint和加锁

* fix:解决冲突

* fix:二次判断
This commit is contained in:
himawari
2022-01-09 23:21:36 +08:00
committed by GitHub
parent d8991ec016
commit 2ed25c6991
8 changed files with 377 additions and 20 deletions

View File

@@ -20,7 +20,7 @@ import (
"github.com/FloatTech/ZeroBot-Plugin/control"
aireply "github.com/FloatTech/ZeroBot-Plugin/plugin_ai_reply"
fileutil "github.com/FloatTech/ZeroBot-Plugin/utils/file"
"github.com/FloatTech/ZeroBot-Plugin/utils/file"
"github.com/FloatTech/ZeroBot-Plugin/utils/web"
)
@@ -57,7 +57,7 @@ func init() {
syntPath := getSyntPath()
fileName := getWav(textReply, syntPath, vocoderList[1], ctx.Event.UserID)
// 回复
ctx.SendChain(message.Record("file:///" + fileutil.BOTPATH + "/" + cachePath + fileName))
ctx.SendChain(message.Record("file:///" + file.BOTPATH + "/" + cachePath + fileName))
})
}
@@ -126,7 +126,7 @@ func getWav(text, syntPath, vocoder string, uid int64) (fileName string) {
}
defer res.Body.Close()
data, _ := ioutil.ReadAll(res.Body)
err = ioutil.WriteFile(cachePath+fileName, data, 0666)
err = os.WriteFile(cachePath+fileName, data, 0666)
if err != nil {
log.Errorln("[mockingbird]:", err)
}