Commit 9cd044c4 authored by wdvxdr's avatar wdvxdr

Merge branch 'dev' of https://github.com/wdvxdr1123/go-cqhttp into dev

parents add9d3fc 0d1dfeef
......@@ -53,7 +53,7 @@ func IsAMRorSILK(b []byte) bool {
}
func FindFile(f, cache, PATH string) (data []byte, err error) {
data, err = nil, errors.New("can't find the file: "+f)
data, err = nil, errors.New("syntax error")
if strings.HasPrefix(f, "http") || strings.HasPrefix(f, "https") {
if cache == "" {
cache = "1"
......@@ -74,7 +74,8 @@ func FindFile(f, cache, PATH string) (data []byte, err error) {
return nil, err
}
} else if strings.HasPrefix(f, "file") {
fu, err := url.Parse(f)
var fu *url.URL
fu, err = url.Parse(f)
if err != nil {
return nil, err
}
......
......@@ -303,10 +303,14 @@ func main() {
var times uint = 1
for {
if conf.ReLogin.MaxReloginTimes == 0 {
} else if times > conf.ReLogin.MaxReloginTimes {
if cli.Online {
log.Warn("Bot已登录")
return
}
if conf.ReLogin.MaxReloginTimes != 0 && times > conf.ReLogin.MaxReloginTimes {
break
}
log.Warnf("Bot已离线 (%v),将在 %v 秒后尝试重连. 重连次数:%v",
e.Message, conf.ReLogin.ReLoginDelay, times)
times++
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment