1
0
mirror of https://github.com/Mrs4s/MiraiGo.git synced 2025-05-05 03:23:50 +08:00

Keep private message length as 5k

This commit is contained in:
sam01101 2021-03-20 21:29:13 +08:00 committed by GitHub
parent cd01eed601
commit f7e5b326dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,7 @@ func (c *QQClient) SendPrivateMessage(target int64, m *message.SendingMessage) *
t := time.Now().Unix()
imgCount := m.Count(func(e message.IMessageElement) bool { return e.Type() == message.Image })
msgLen := message.EstimateLength(m.Elements, 703)
if msgLen > 703 || imgCount > 50 {
if msgLen > 5000 || imgCount > 50 {
return nil
}
if msgLen > 300 || imgCount > 2 {