搜图下载使用animeapi,将文件判存移至utils

This commit is contained in:
fumiama
2021-10-23 00:54:38 +08:00
parent 591df6439c
commit 67555512e7
11 changed files with 108 additions and 56 deletions

View File

@@ -7,6 +7,7 @@ import (
"os"
"time"
"github.com/FloatTech/ZeroBot-Plugin/utils/file"
wr "github.com/mroth/weightedrand"
log "github.com/sirupsen/logrus"
)
@@ -53,7 +54,7 @@ func init() {
// load 加载rate数据
func load(area *rate) error {
if _, err := os.Stat(jsonfile); err == nil || os.IsExist(err) {
if file.IsExist(jsonfile) {
f, err := os.Open(jsonfile)
if err == nil {
defer f.Close()