We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
npm run doctor
触发room-join event 时,获取当前机器人的contact.id
代码如下:
.on('room-join', (room, invitee, inviter) => { const user = bot.user() console.log(user.id) })
运行报错:
orangiss/testfun.ts(31,15): Object is possibly 'null'. (2531)
检查发现,虽然console.log(user.id)会运行报错,但是console.log(user)可以正常显示user内容。 user类型为Contact,理论上Contact.id 是可以成功获取到id的,但是在room-join事件触发时不可以。
进一步将代码修改为:
console.log((user as any).id)
可以成功的运行并获取到user.id
希望可以修复此bug。
The text was updated successfully, but these errors were encountered:
dda941b
当我使用在room中使用 Room.topic() 时, 遇见了同样的bug
Sorry, something went wrong.
No branches or pull requests
Please run
npm run doctor
and paste the output hereWechaty Doctor
Expected behavior
触发room-join event 时,获取当前机器人的contact.id
代码如下:
Actual behavior
运行报错:
处理办法:
检查发现,虽然console.log(user.id)会运行报错,但是console.log(user)可以正常显示user内容。
user类型为Contact,理论上Contact.id 是可以成功获取到id的,但是在room-join事件触发时不可以。
进一步将代码修改为:
可以成功的运行并获取到user.id
希望可以修复此bug。
The text was updated successfully, but these errors were encountered: