mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-05 03:23:49 +08:00
fix typo.
This commit is contained in:
parent
dc18944a98
commit
ae806c53bb
@ -277,8 +277,8 @@ func DefaultConfig() *JSONConfig {
|
||||
}
|
||||
}
|
||||
|
||||
//Load 加载配置文件
|
||||
func Load(p string) *JSONConfig {
|
||||
//LoadConfig 加载配置文件
|
||||
func LoadConfig(p string) *JSONConfig {
|
||||
if !PathExists(p) {
|
||||
log.Warnf("尝试加载配置文件 %v 失败: 文件不存在", p)
|
||||
return nil
|
||||
|
4
main.go
4
main.go
@ -469,7 +469,7 @@ func restart(Args []string) {
|
||||
func getConfig() *global.JSONConfig {
|
||||
var conf *global.JSONConfig
|
||||
if global.PathExists("config.json") {
|
||||
conf = global.Load("config.json")
|
||||
conf = global.LoadConfig("config.json")
|
||||
_ = conf.Save("config.hjson")
|
||||
_ = os.Remove("config.json")
|
||||
} else if os.Getenv("UIN") != "" {
|
||||
@ -498,7 +498,7 @@ func getConfig() *global.JSONConfig {
|
||||
conf.HTTPConfig.PostUrls[post] = os.Getenv("HTTP_SECRET")
|
||||
}
|
||||
} else {
|
||||
conf = global.Load("config.hjson")
|
||||
conf = global.LoadConfig("config.hjson")
|
||||
}
|
||||
if conf == nil {
|
||||
err := global.WriteAllText("config.hjson", global.DefaultConfigWithComments)
|
||||
|
@ -333,7 +333,7 @@ func GetConf() *global.JSONConfig {
|
||||
if JSONConfig != nil {
|
||||
return JSONConfig
|
||||
}
|
||||
conf := global.Load("config.hjson")
|
||||
conf := global.LoadConfig("config.hjson")
|
||||
return conf
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user