mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-06 12:03:50 +08:00
Merge pull request #601 from sam01101/patch-2
isFastStart setting appiled to config.hjson gen
This commit is contained in:
commit
e7547ed257
6
main.go
6
main.go
@ -36,6 +36,7 @@ import (
|
|||||||
|
|
||||||
var json = jsoniter.ConfigCompatibleWithStandardLibrary
|
var json = jsoniter.ConfigCompatibleWithStandardLibrary
|
||||||
var conf *global.JSONConfig
|
var conf *global.JSONConfig
|
||||||
|
var isFastStart = false
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
if global.PathExists("cqhttp.json") {
|
if global.PathExists("cqhttp.json") {
|
||||||
@ -115,7 +116,6 @@ func init() {
|
|||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
var byteKey []byte
|
var byteKey []byte
|
||||||
var isFastStart = false
|
|
||||||
arg := os.Args
|
arg := os.Args
|
||||||
if len(arg) > 1 {
|
if len(arg) > 1 {
|
||||||
for i := range arg {
|
for i := range arg {
|
||||||
@ -139,7 +139,9 @@ func main() {
|
|||||||
|
|
||||||
if conf.Uin == 0 || (conf.Password == "" && conf.PasswordEncrypted == "") {
|
if conf.Uin == 0 || (conf.Password == "" && conf.PasswordEncrypted == "") {
|
||||||
log.Warnf("请修改 config.hjson 以添加账号密码.")
|
log.Warnf("请修改 config.hjson 以添加账号密码.")
|
||||||
|
if (!isFastStart) {
|
||||||
time.Sleep(time.Second * 5)
|
time.Sleep(time.Second * 5)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -467,7 +469,9 @@ func getConfig() *global.JSONConfig {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
log.Infof("默认配置文件已生成, 请编辑 config.hjson 后重启程序.")
|
log.Infof("默认配置文件已生成, 请编辑 config.hjson 后重启程序.")
|
||||||
|
if (!isFastStart) {
|
||||||
time.Sleep(time.Second * 5)
|
time.Sleep(time.Second * 5)
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return conf
|
return conf
|
||||||
|
Loading…
x
Reference in New Issue
Block a user