wechaty / puppet-xp

Wechaty Puppet WeChat Windows Protocol
http://wechaty.js.org/docs/puppet-providers/xp
Apache License 2.0
472 stars 114 forks source link

拿到群消息时每次获取 msg.room().memberAll() 会报错,第一次是好的 #195

Open danni-cool opened 1 year ago

danni-cool commented 1 year ago

Message: Message#Text[🗣ContactDaniel>@👥Room<加时间] 面南背北 Waiting for the debugger to disconnect... D:\wechatRoomBot\node_modules\wechaty\dist\cjs\src\user-modules\room.js:895 const contactListAll = await Promise.all(memberIdList.map(id => this.wechaty.Contact.find({ id }))); ^

TypeError: Cannot read properties of undefined (reading 'map') at WechatifiedUserClass.memberList (D:\wechatRoomBot\node_modules\wechaty\dist\cjs\src\user-modules\room.js:895:63) at async Object.sendMsg2RecvdApi (D:\wechatRoomBot\src\service\webhook.js:49:28)

Node.js v18.17.1

memberIdList 有时候有,有时候无,第一次是有的,后面几次群消息再去查询 memberIdList 就变成undefined了