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) {
|
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 strings.HasPrefix(f, "http") || strings.HasPrefix(f, "https") {
|
||||||
if cache == "" {
|
if cache == "" {
|
||||||
cache = "1"
|
cache = "1"
|
||||||
@ -74,7 +74,8 @@ func FindFile(f, cache, PATH string) (data []byte, err error) {
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
} else if strings.HasPrefix(f, "file") {
|
} else if strings.HasPrefix(f, "file") {
|
||||||
fu, err := url.Parse(f)
|
var fu *url.URL
|
||||||
|
fu, err = url.Parse(f)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
8
main.go
8
main.go
@ -303,10 +303,14 @@ func main() {
|
|||||||
var times uint = 1
|
var times uint = 1
|
||||||
for {
|
for {
|
||||||
|
|
||||||
if conf.ReLogin.MaxReloginTimes == 0 {
|
if cli.Online {
|
||||||
} else if times > conf.ReLogin.MaxReloginTimes {
|
log.Warn("Bot已登录")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
if conf.ReLogin.MaxReloginTimes != 0 && times > conf.ReLogin.MaxReloginTimes {
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Warnf("Bot已离线 (%v),将在 %v 秒后尝试重连. 重连次数:%v",
|
log.Warnf("Bot已离线 (%v),将在 %v 秒后尝试重连. 重连次数:%v",
|
||||||
e.Message, conf.ReLogin.ReLoginDelay, times)
|
e.Message, conf.ReLogin.ReLoginDelay, times)
|
||||||
times++
|
times++
|
||||||
|
Loading…
x
Reference in New Issue
Block a user