Closed atorber closed 3 years ago
@atorber 想请问一下这个问题你解决了吗?我也遇到了很类似的问题。
需要padlocal在服务端操作一下,只有第一次登录可以算量获得联系人,之后登录是增量,频繁bot.Contact.findAll()可能出发微信风控,不建议每次ready都全量请求,需要本地或数据库缓存 之前咨询了官方的总结
需要padlocal在服务端操作一下,只有第一次登录可以算量获得联系人,之后登录是增量,频繁bot.Contact.findAll()可能出发微信风控,不建议每次ready都全量请求,需要本地或数据库缓存 之前咨询了官方的总结
@atorber 谢谢回答。是需要联系padlocal的客服来操作吗? 我遇到的情况是直接node运行代码没有任何问题,build成docker镜像就会获取不到好友列表,在所有的机器上都是一样的问题。不知道padlocal是怎么判断第一次登陆和之后登陆的。
经过作者回复已经解决了问题🙏
解决方法是在调用Wechaty.Contact.findAll()
之前先调用wechaty-puppet-padlocal.syncContact()
,等同步结束后就可以正常获取联系人了
It seems that the ready
event should not emit until the syncContact()
has been returned.
wechaty-puppet-padlocal.syncContact()
@huan I wonder if we can automatically call wechaty-puppet-padlocal.syncContact() in onScan event when it is called in puppet-padlocal?
Wechaty should not know anything from the PadLocal except the Puppet Interface.
This logic should belong to the PadLocal and deal I side it.
Yes, I mean to implement the above operations in the onScan event of puppet-padlocal, @padlocal do you think this is reasonable?
在docker中运行ready之后立即调bot.Contact.findAll() 获取不到完整的联系人列表,只能拿到当前登陆账号自己的信息