set def api host

This commit is contained in:
YouROK
2025-04-25 12:24:15 +03:00
parent 7b149d8744
commit 6d564a02ab

View File

@@ -24,6 +24,7 @@ func LoadConfig() {
if err != nil { if err != nil {
Cfg.WhiteIds = []int64{} Cfg.WhiteIds = []int64{}
Cfg.BlackIds = []int64{} Cfg.BlackIds = []int64{}
Cfg.HostTG = "https://api.telegram.org"
buf, _ = json.MarshalIndent(Cfg, "", " ") buf, _ = json.MarshalIndent(Cfg, "", " ")
if buf != nil { if buf != nil {
os.WriteFile(fn, buf, 0666) os.WriteFile(fn, buf, 0666)
@@ -34,4 +35,7 @@ func LoadConfig() {
if err != nil { if err != nil {
log.TLogln("Error read tg config:", err) log.TLogln("Error read tg config:", err)
} }
if Cfg.HostTG == "" {
Cfg.HostTG = "https://api.telegram.org"
}
} }