SendUserMessage中限制钉钉消息长度的BUG

This commit is contained in:
gazebo
2019-11-15 21:33:37 +08:00
parent da69dd0216
commit 0f0e1bb5a3

View File

@@ -31,7 +31,7 @@ func SendUserMessage(msgType, userID, title, content string) (err error) {
for _, auth := range authList {
if auth.Type == dingding.AuthTypeStaff || auth.Type == weixin.AuthTypeMP {
findOneMethod = true
if msgType == dingdingapi.MsgTypeMarkdown && len(content) > dingdingapi.MaxWorkContentLen {
if len(content) > dingdingapi.MaxWorkContentLen {
content = content[:dingdingapi.MaxWorkContentLen-4] + "..."
}
err = SendDDUserMessage(msgType, auth.AuthID, title, content)