wechaty / wechaty-puppet-padpro

Apache License 2.0
238 stars 64 forks source link

"room-join"不能正常使用 报错UnhandledPromiseRejectionWarning: Error: no id #189

Closed snaildarter closed 5 years ago

snaildarter commented 5 years ago

重要:请不要删除模板自行填写,所有不按照模板填写的issue,我们将不会处理。

0. 发 Issue 指南

  1. 请运行下面的命令,看问题是否可以被解决:

    rm -rf package-lock.json
    rm -rf node_modules
    npm install
  2. 请在 FAQ 清单 看是否已有解决办法。

  3. 请先在issue 中搜关键信息,确认你要发的内容和之前的issue 不重复。

1. 提供你的包版本信息

2. Bug 描述

请用精简的语言描述你遇到的bug 预期能正常@联系人 发送消息

3. 复现的步骤 (或者解决的步骤)

群里进人就直接报错

这一部分非常重要,如果你无法给出复现步骤,我们也很难提供相应的解决办法:

复现步骤中一定要给出复现代码 ('room-join', (room, inviteeList, inviter) => { const id = room.id; if (id === 'roomId') { try { room.say(欢迎加入《群》, inviteeList); } catch (e) {} room.say(欢迎加入《群》); } }

例子:

4. 期待程序运行的结果

请用精简的语言描述你期待运行的结果 是指定的群 有人加入,可以@新进人 发送消息

5. 程序实际运行的结果

请用精简的语言或者截图描述实际运行的结果(请不要在这里粘贴日志截图

什么消息也没有发送

6. 完整的日志信息:

通过WECHATY_LOG=silly设定环境变量,将设置log 等级为 silly,获取最详细的日志信息(默认log 等级为 info) 请提供完整的日志信息(不要只提供部分的日志截图,请复制粘贴日志内容!)

Show Logs ```shell $ WECHATY_LOG=silly node yourbot.js ```

UnhandledPromiseRejectionWarning: Error: no id at PuppetPadpro. (/home/wxbot/node_modules/wechaty-puppet/dist/src/puppet.js:732:23) at Generator.next () at /home/wxbot/node_modules/wechaty-puppet/dist/src/puppet.js:25:71 at new Promise () at awaiter (/home/wxbot/node_modules/wechaty-puppet/dist/src/puppet.js:21:12) at PuppetPadpro.roomMemberPayload (/home/wxbot/node_modules/wechaty-puppet/dist/src/puppet.js:729:16) at AnotherOriginalClass. (/home/wxbot/node_modules/wechaty/dist/src/user/room.js:753:53) at Generator.next () at /home/wxbot/node_modules/wechaty/dist/src/user/room.js:7:71 at new Promise () at awaiter (/home/wxbot/node_modules/wechaty/dist/src/user/room.js:3:12) at AnotherOriginalClass.alias (/home/wxbot/node_modules/wechaty/dist/src/user/room.js:752:16) at AnotherOriginalClass. (/home/wxbot/node_modules/wechaty/dist/src/user/room.js:374:162) at Generator.next () at /home/wxbot/node_modules/wechaty/dist/src/user/room.js:7:71 at new Promise () at awaiter (/home/wxbot/node_modules/wechaty/dist/src/user/room.js:3:12) at Promise.all.mentionList.map (/home/wxbot/node_modules/wechaty/dist/src/user/room.js:374:89) at Array.map () at AnotherOriginalClass. (/home/wxbot/node_modules/wechaty/dist/src/user/room.js:374:72) at Generator.next () at /home/wxbot/node_modules/wechaty/dist/src/user/room.js:7:71 at new Promise () at awaiter (/home/wxbot/node_modules/wechaty/dist/src/user/room.js:3:12) at AnotherOriginalClass.say (/home/wxbot/node_modules/wechaty/dist/src/user/room.js:368:16) at Wechaty.bot.on.on.on.on (/home/wxbot/index.js:156:18) at Wechaty.on.args (/home/wxbot/node_modules/wechaty/dist/src/wechaty.js:385:26) at Wechaty.emit (events.js:182:13) at Wechaty.EventEmitter.emit (domain.js:441:20) at Wechaty.emit (/home/wxbot/node_modules/wechaty/dist/src/wechaty.js:181:22) at Wechaty. (/home/wxbot/node_modules/wechaty/dist/src/wechaty.js:502:30) at Generator.next () at fulfilled (/home/wxbot/node_modules/wechaty/dist/src/wechaty.js:4:58)

7. 其他信息

有相关bug 的背景信息,可以在这里说明

[bug]

snaildarter commented 5 years ago

room.say('some text', ... Contact[]) 参数传入错误