mirror of
https://github.com/FloatTech/ZeroBot-Plugin.git
synced 2025-12-20 06:20:08 +08:00
✏️ 优化代码结构
This commit is contained in:
parent
1e49bad1a6
commit
8499921d67
@ -6,6 +6,7 @@ import (
|
|||||||
|
|
||||||
"github.com/FloatTech/ZeroBot-Plugin/utils/file"
|
"github.com/FloatTech/ZeroBot-Plugin/utils/file"
|
||||||
"github.com/FloatTech/ZeroBot-Plugin/utils/process"
|
"github.com/FloatTech/ZeroBot-Plugin/utils/process"
|
||||||
|
"github.com/sirupsen/logrus"
|
||||||
)
|
)
|
||||||
|
|
||||||
type kimo = map[string]*[]string
|
type kimo = map[string]*[]string
|
||||||
@ -22,6 +23,7 @@ func initChatList(postinit func()) {
|
|||||||
for k := range kimomap {
|
for k := range kimomap {
|
||||||
chatList = append(chatList, k)
|
chatList = append(chatList, k)
|
||||||
}
|
}
|
||||||
|
logrus.Infoln("[chat]加载", len(chatList), "条kimoi")
|
||||||
postinit()
|
postinit()
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -38,7 +38,7 @@ func GetLazyData(path string, isReturnDataBytes, isDataMustEqual bool) ([]byte,
|
|||||||
} else {
|
} else {
|
||||||
ms, err = registry.Get(path)
|
ms, err = registry.Get(path)
|
||||||
if err != nil || len(ms) != 16 {
|
if err != nil || len(ms) != 16 {
|
||||||
logrus.Errorln("[file]获取md5失败,请自行确保下载文件 %s 的正确性:", path, err)
|
logrus.Errorln("[file]获取md5失败,请自行确保下载文件", path, "的正确性:", err)
|
||||||
} else {
|
} else {
|
||||||
filemd5 = (*[16]byte)(*(*unsafe.Pointer)(unsafe.Pointer(&ms)))
|
filemd5 = (*[16]byte)(*(*unsafe.Pointer)(unsafe.Pointer(&ms)))
|
||||||
logrus.Infoln("[file]从验证服务器获得文件md5:", hex.EncodeToString(filemd5[:]))
|
logrus.Infoln("[file]从验证服务器获得文件md5:", hex.EncodeToString(filemd5[:]))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user