-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v3: reborn 重构wechatbot-webhook #223
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
原本收到合并消息转发的消息,会直接抛出错误,现在捕获这个错误并处理
原本收到合并消息转发的消息,会直接抛出错误,现在捕获这个错误并处理 ``` [2024-05-15T17:46:41.442] [WARN] - 17:46:41 WARN message-parser Error occurred while parse message attachment: {"MsgId":"9077318394394722874","FromUserName":"@@XXXXXXXXXXX","ToUserName":"@xxxxxxxxxx","MsgType":49,"Content":"@xxxxxxxxxxxx:\n该类型暂不支持,请在手机上查看","Status":3,"ImgStatus":2,"CreateTime":1715766398,"VoiceLength":0,"PlayLength":0,"FileName":"","FileSize":"","MediaId":"","Url":"","AppMsgType":0,"StatusNotifyCode":0,"StatusNotifyUserName":"","RecommendInfo":{"UserName":"","NickName":"","QQNum":0,"Province":"","City":"","Content":"","Signature":"","Alias":"","Scene":0,"VerifyFlag":0,"AttrStatus":0,"Sex":0,"Ticket":"","OpCode":0},"ForwardFlag":0,"AppInfo":{"AppID":"","Type":0},"HasProductId":0,"Ticket":"","ImgHeight":0,"ImgWidth":0,"SubMsgType":0,"NewMsgId":9077318394394723000,"OriContent":"","EncryFileName":"","isSendBySelf":false,"OriginalContent":"@xxxxxxxxxxxx:<br/>该类型暂不支持,请在手机上查看"} , TypeError: Cannot read properties of undefined (reading 'msg') at parseAppmsgMessagePayload (/app/node_modules/.pnpm/[email protected]_patch_hash=nq4vns7vah46g6vxziyzqg5jey_@[email protected][email protected]/node_modules/wechaty-puppet-wechat4u/dist/cjs/src/wechat4u/messages/message-appmsg.js:34:76) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async appMsgParser (/app/node_modules/.pnpm/[email protected]_patch_hash=nq4vns7vah46g6vxziyzqg5jey_@[email protected][email protected]/node_modules/wechaty-puppet-wechat4u/dist/cjs/src/wechat4u/schema-mapper/message/message-parser-appmsg.js:36:28) at async executeMessageParsers (/app/node_modules/.pnpm/[email protected]_patch_hash=nq4vns7vah46g6vxziyzqg5jey_@[email protected][email protected]/node_modules/wechaty-puppet-wechat4u/dist/cjs/src/wechat4u/schema-mapper/message/message-parser.js:15:15) at async webMessageToWechaty (/app/node_modules/.pnpm/[email protected]_patch_hash=nq4vns7vah46g6vxziyzqg5jey_@[email protected][email protected]/node_modules/wechaty-puppet-wechat4u/dist/cjs/src/wechat4u/schema-mapper/message.js:70:5) at async PuppetWechat4u.messagePayload (/app/node_modules/.pnpm/[email protected][email protected]/node_modules/wechaty-puppet/dist/cjs/src/mixins/message-mixin.js:50:29) at async PuppetWechat4u.messageSearch (/app/node_modules/.pnpm/[email protected][email protected]/node_modules/wechaty-puppet/dist/cjs/src/mixins/message-mixin.js:67:21) at async WechatifiedMessageImpl.findAll (/app/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/wechaty/dist/cjs/src/user-modules/message.js:98:35) at async WechatifiedMessageImpl.find (/app/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/wechaty/dist/cjs/src/user-modules/message.js:81:29) at async PuppetWechat4u.<anonymous> (/app/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/wechaty/dist/cjs/src/wechaty-mixins/puppet-mixin.js:240:45) [2024-05-15T17:46:41.443] [INFO] - Message: Message#Attachment[🗣Contact<ʚDayday🥱ɞ>@👥Room<🤖测试>] [2024-05-15T17:46:41.444] [ERROR] - 向 RECVD_MSG_API 上报 message 事件出错: Error: unsupported message. id: 9077318394394722874 at PuppetWechat4u.messageFile (/app/node_modules/.pnpm/[email protected]_patch_hash=nq4vns7vah46g6vxziyzqg5jey_@[email protected][email protected]/node_modules/wechaty-puppet-wechat4u/dist/cjs/src/puppet-wechat4u.js:592:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async WechatifiedUserClass.toFileBox (/app/node_modules/.pnpm/[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/wechaty/dist/cjs/src/user-modules/message.js:832:25) at async sendMsg2RecvdApi (/app/src/service/msgUploader.js:133:41) at async Object.onRecvdMessage (/app/src/service/msgSender.js:694:10) ``` 如果 `const steamFile = msg.toFileBox ? await msg.toFileBox() : msg.content()` 这里没有抛出错误,则流程和以前一样
✅ Closes: #220
## 调整 - 调整和优化了重复代码 - 转发确实是附件类型,但是简单归为 combineforward 欠妥,假如是真实附件,因为特殊原因报错了,也可能进入这个逻辑,这个时候这里就不是combineforward了 - 暂时将这个分支归到unknown类型里,好像就算展示了文本,也没啥用,但是解决了报错问题 👏 @Daydaylw3 - web协议能力还是有限(日常吐槽)
✅ Closes: #212
✅ Closes: #193
This was
linked to
issues
Jul 19, 2024
Closed
Open
Open
Open
Open
This was
unlinked from
issues
Jul 19, 2024
Closed
Open
Open
Open
Open
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
breaking change
feature
bugfix
doc