mirror of
https://github.com/Mrs4s/go-cqhttp.git
synced 2025-05-05 03:23:49 +08:00
feature auto fragment.
This commit is contained in:
parent
abd32556cb
commit
054ad47da9
@ -222,7 +222,13 @@ func (bot *CQBot) SendGroupMessage(groupId int64, m *message.SendingMessage) int
|
|||||||
ret := bot.Client.SendGroupMessage(groupId, m, ForceFragmented)
|
ret := bot.Client.SendGroupMessage(groupId, m, ForceFragmented)
|
||||||
if ret == nil || ret.Id == -1 {
|
if ret == nil || ret.Id == -1 {
|
||||||
log.Warnf("群消息发送失败: 账号可能被风控.")
|
log.Warnf("群消息发送失败: 账号可能被风控.")
|
||||||
return -1
|
if !ForceFragmented {
|
||||||
|
log.Warnf("将尝试分片发送...")
|
||||||
|
ret = bot.Client.SendGroupMessage(groupId, m, true)
|
||||||
|
}
|
||||||
|
if ret == nil || ret.Id == -1 {
|
||||||
|
return -1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return bot.InsertGroupMessage(ret)
|
return bot.InsertGroupMessage(ret)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user