diff --git a/coolq/bot.go b/coolq/bot.go index 06c02ff..628c41e 100644 --- a/coolq/bot.go +++ b/coolq/bot.go @@ -42,7 +42,7 @@ func NewQQBot(cli *client.QQClient, conf *global.JsonConfig) *CQBot { p := path.Join("data", "leveldb") db, err := leveldb.OpenFile(p, nil) if err != nil { - log.Fatalf("打开数据库失败, 如果频繁遇到此问题请清理 data/db 文件夹或关闭数据库功能。") + log.Fatalf("打开数据库失败, 如果频繁遇到此问题请清理 data/leveldb 文件夹或关闭数据库功能。") } bot.db = db gob.Register(message.Sender{}) diff --git a/global/fs.go b/global/fs.go index e5fb7ca..bdf842c 100644 --- a/global/fs.go +++ b/global/fs.go @@ -124,4 +124,4 @@ func (wc *WriteCounter) Write(p []byte) (int, error) { func (wc WriteCounter) PrintProgress() { fmt.Printf("\r%s", strings.Repeat(" ", 35)) fmt.Printf("\rDownloading... %s complete", humanize.Bytes(wc.Total)) -} \ No newline at end of file +} diff --git a/main.go b/main.go index 5db539c..6025ed4 100644 --- a/main.go +++ b/main.go @@ -95,7 +95,7 @@ func main() { console := bufio.NewReader(os.Stdin) arg := os.Args - if len(arg) >1 && arg[1] == "update"{ + if len(arg) > 1 && arg[1] == "update" { if len(arg) > 2 { selfUpdate(arg[2]) } else { @@ -390,4 +390,4 @@ func selfUpdate(imageUrl string) { log.Info("按 Enter 继续....") readLine() os.Exit(0) -} \ No newline at end of file +} diff --git a/server/apiAdmin.go b/server/apiAdmin.go index 637b088..78e01da 100644 --- a/server/apiAdmin.go +++ b/server/apiAdmin.go @@ -406,6 +406,7 @@ func (s *webServer) ReloadServer() { // 热重启 func AdminDoRestart(s *webServer, c *gin.Context) { + s.bot.Release() s.bot = nil s.Cli = nil s.DoReLogin()