wechaty / puppet-wechat

Wechaty Puppet Provider for WeChat
https://www.npmjs.com/package/wechaty-puppet-wechat
Apache License 2.0
418 stars 71 forks source link

room-join 和 room-leave 事件无效 #182

Open raoooool opened 2 years ago

raoooool commented 2 years ago

现象

room-join 和 room-leave 事件无效, 未触发事件

依赖

 "dependencies": {
    "qrcode-terminal": "^0.12.0",
    "typescript": "^4.5.2",
    "wechaty": "^1.11.25",
    "wechaty-puppet-wechat": "^1.11.1"
  },

代码

bot.on("room-join", async function (room, inviteeList, inviter) {
  log.info(
    "Bot",
    'EVENT: room-join - Room "%s" got new member "%s", invited by "%s"',
    await room.topic(),
    inviteeList.map((c) => c.name()).join(","),
    inviter.name()
  );
  console.log("bot room-join room id:", room.id);
  const topic = await room.topic();
  await room.say(`welcome to "${topic}"!`, inviteeList[0]);
});
raoooool commented 2 years ago

找到原因了,是因为被邀请人的微信名称里包含 emoji 导致的,希望可以 fix 这个问题。

huan commented 2 years ago

If you want to make the fix possible, please help us to add your case to the unit test below:

https://github.com/wechaty/puppet-wechat/blob/1442099e5cbf107d97f11e99f3dee2e793260aa8/src/firer.spec.ts#L67-L134

raoooool commented 2 years ago

If you want to make the fix possible, please help us to add your case to the unit test below:

https://github.com/wechaty/puppet-wechat/blob/1442099e5cbf107d97f11e99f3dee2e793260aa8/src/firer.spec.ts#L67-L134

Ok, I will do it later.