From 054ad47da90b7986beac771581b015cec6eb602c Mon Sep 17 00:00:00 2001 From: Mrs4s Date: Thu, 10 Dec 2020 01:32:08 +0800 Subject: [PATCH] feature auto fragment. --- coolq/bot.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/coolq/bot.go b/coolq/bot.go index 45d6861..8680d57 100644 --- a/coolq/bot.go +++ b/coolq/bot.go @@ -222,7 +222,13 @@ func (bot *CQBot) SendGroupMessage(groupId int64, m *message.SendingMessage) int ret := bot.Client.SendGroupMessage(groupId, m, ForceFragmented) if ret == nil || ret.Id == -1 { 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) }