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

fix issue of sending the empty message.

This commit is contained in:
Mrs4s 2020-10-25 22:06:03 +08:00
parent 6ad0d68978
commit 84b4889def

View File

@ -211,6 +211,10 @@ func (bot *CQBot) SendGroupMessage(groupId int64, m *message.SendingMessage) int
}
newElem = append(newElem, elem)
}
if len(newElem) == 0 {
log.Warnf("群消息发送失败: 消息为空.")
return -1
}
m.Elements = newElem
ret := bot.Client.SendGroupMessage(groupId, m, ForceFragmented)
if ret == nil || ret.Id == -1 {