mirror of
https://github.com/Mrs4s/MiraiGo.git
synced 2025-05-12 06:45:46 +08:00
Merge branch 'dev' of https://github.com/wdvxdr1123/go-cqhttp into dev
This commit is contained in:
commit
9cd044c402
@ -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
|
||||
}
|
||||
|
8
main.go
8
main.go
@ -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++
|
||||
|
Loading…
x
Reference in New Issue
Block a user