wechaty / puppet-wechat4u

Wechat4u Puppet for Wechaty
https://www.npmjs.com/package/wechaty-puppet-wechat4u
Apache License 2.0
99 stars 34 forks source link

群text类型消息包含:\n时消息被截断 #75

Open hmllsnow opened 5 months ago

hmllsnow commented 5 months ago

当群text类型消息包含:\n时,消息被截断。 检查可能是wechat4u/schema-mapper/message/message-parser-room.ts类中, 可能是消息内容处理存在问题 const parts = webMessageRawPayload.Content.split(':\n') if (parts.length > 1) { text = parts[1] } else { text = webMessageRawPayload.Content }

huan commented 5 months ago

Good catch! I would love to accept a PR with Unit Test to fix it!

Nimbly8836 commented 2 months ago

The possible solution I discovered. const split = content.split(/^.+:\n/) Including the function roomMessageSentBySelf.