1
0
mirror of https://github.com/Mrs4s/go-cqhttp.git synced 2025-05-05 19:43:49 +08:00

update default heartbeat value. close #232

This commit is contained in:
Mrs4s 2020-09-05 08:09:07 +08:00
parent 42434956d9
commit a991add799

View File

@ -71,10 +71,13 @@ func NewQQBot(cli *client.QQClient, conf *global.JsonConfig) *CQBot {
bot.Client.OnUserWantJoinGroup(bot.groupJoinReqEvent)
go func() {
i := conf.HeartbeatInterval
if i < 1 {
if i < 0 {
log.Warn("警告: 心跳功能已关闭,若非预期,请检查配置文件。")
return
}
if i == 0 {
i = 5
}
for {
time.Sleep(time.Second * i)
bot.dispatchEventMessage(MSG{